Created
February 12, 2020 18:10
-
-
Save varghes/211847fa710d474cc65569a6ed5c41e9 to your computer and use it in GitHub Desktop.
stm8s103f3p6 blink Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <STM8S103F3P.h> | |
void myDelay(void); | |
void myDelay() | |
{ | |
int i,j; | |
for(i=0;i<1000;i++) | |
{ | |
for(j=0;j<100;) | |
{ | |
j++; | |
} | |
} | |
} | |
main() | |
{ | |
PB_DDR |=0x20;// PB.5 as Output | |
PB_CR1 |=0x20;// PB.5 as Push Pull Type Output | |
while(1) | |
{ | |
PB_ODR |=1<<5;// PB.5 = 1 | |
myDelay(); | |
PB_ODR &=~(1<<5);// PB.5 = 0 | |
myDelay(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment