Advertisement
xorkrus

kj

Dec 12th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. $regfile = "attiny13.dat"
  2. $crystal = 4800000
  3. $hwstack = 8
  4. $swstack = 16
  5. $framesize = 16
  6.  
  7. Dim S1 As Byte
  8. S1 = 0
  9.  
  10. Config Portb.2 = Output
  11. Config Portb.3 = Output
  12. Config Portb.1 = Input
  13.  
  14. Config Int0 = Falling
  15. On Int0 Button:
  16. Enable Interrupts
  17. Enable Int0
  18.  
  19. Do
  20. If S1 = 0 Then
  21. Portb.2 = 0
  22. Portb.3 = 0
  23. Powerdown
  24. End If
  25.  
  26. If S1 = 4 Then
  27. S1 = 0
  28. End if
  29.  
  30. Loop
  31.  
  32. Button:
  33. Wait 1
  34.  
  35. Incr S1
  36. If S1 = 1 Then
  37. Portb.2 = 1
  38. Portb.3 = 0
  39. End If
  40. If S1 = 2 Then
  41. Portb.2 = 0
  42. Portb.3 = 1
  43. End If
  44. If S1 = 3 Then
  45. Portb.2 = 1
  46. Portb.3 = 1
  47. End If
  48.  
  49. Gifr = 64
  50. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement