Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include "stm32f10x.h"
  2. int main(void)
  3. {
  4. RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
  5. GPIO_InitTypeDef tmp;
  6. tmp.GPIO_Mode=GPIO_Mode_Out_PP;
  7. tmp.GPIO_Speed=GPIO_Speed_2MHz;
  8. tmp.GPIO_Pin = GPIO_Pin_8;
  9. GPIO_Init(GPIOB, &tmp);
  10. SysTick_Config(SystemCoreClock / 1000);
  11. while(1)
  12. {
  13.  
  14. }
  15. }
  16. void SysTick_Handler()
  17. {
  18. GPIO_WriteBit(GPIOB, GPIO_Pin_9,(BitAction)((1-GPIO_ReadOutputDataBit(GPIO_Pin_8))));
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement