Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <REGX52.H>
  2.  
  3. typedef unsigned char byte;
  4.  
  5. byte xdata CRVENE _at_ 0x8000;
  6. byte xdata PLAVE _at_ 0x8003;
  7.  
  8. unsigned char stanja[]={0xFE,0xFC,0xF8,0xF0};
  9.  
  10.  
  11. void main()
  12. {
  13. unsigned char var1;
  14. PLAVE=0x01;
  15.  
  16. while(1)
  17. {
  18. SW12=~CRVENE&0x03;
  19. //SW3=~CRVENE&0x04;
  20.  
  21. switch(SW12){
  22.  
  23. case 0x00:
  24. PLAVE=stanja[0];
  25. break;
  26. case 0x01:
  27. PLAVE=stanja[1];
  28. break;
  29. case 0x02:
  30. PLAVE=stanja[2];
  31. break;
  32. case 0x03:
  33. PLAVE=stanja[3];
  34. break;
  35. }
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement