Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. for(;;)
  2. {
  3. //while(GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_2)){}
  4. if(s1==0 & s2==0){
  5. GPIO_SetBits(GPIOD, GPIO_Pin_12);
  6. GPIO_ResetBits(GPIOD, GPIO_Pin_15);
  7. s1=1;
  8. for (i=0;i<10000000;i++);
  9. }
  10. if(s1==1 & s2==0){
  11. GPIO_SetBits(GPIOD, GPIO_Pin_14);
  12. GPIO_ResetBits(GPIOD, GPIO_Pin_12);
  13. for (i=0;i<10000000;i++);
  14. s1=2;
  15.  
  16. }
  17. if(s1==1 & s2==1){
  18. GPIO_SetBits(GPIOD, GPIO_Pin_13);
  19. GPIO_ResetBits(GPIOD, GPIO_Pin_14);
  20. for (i=0;i<10000000;i++);
  21. s1=0;
  22. }
  23. if(s1==0 & s2==1){
  24. GPIO_SetBits(GPIOD, GPIO_Pin_15);
  25. GPIO_ResetBits(GPIOD, GPIO_Pin_13);
  26. for (i=0;i<10000000;i++);
  27. s2=0;
  28. }
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement