Advertisement
demoss

main.c_ver2

Jul 23rd, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stm32f10x.h>
  2. #include <stm32f10x_rcc.h>
  3. #include <stm32f10x_gpio.h>
  4. void delay(volatile uint32_t nCount) {
  5.     for (; nCount != 0; nCount--);
  6. }
  7. int i;
  8. void main(void)
  9. {
  10.   RCC->APB2ENR|=RCC_APB2ENR_IOPCEN;
  11.   GPIOC->CRH=0x80200000;
  12.    for(i=1;i!=0;i++){
  13.   if(GPIOC->IDR&GPIO_IDR_IDR15)GPIOC->BRR|=GPIO_BSRR_BR13;
  14.   else
  15.     GPIOC->BSRR=GPIO_BSRR_BS13;
  16.   }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement