Advertisement
MelonLupi

radar

Oct 10th, 2017
3,262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $regfile = "m16def.dat"
  2. $crystal = 11059200
  3.  
  4. Config Portb = Output
  5. Config Pinc.0 = Output
  6. Config Pinc.1 = Input
  7.  
  8. Port_led Alias Portb
  9. Middle_led Alias Pinc.0
  10. Button Alias Pinc.1
  11. Button = 1
  12. Dim Data_led As Byte , X As Byte
  13. Dim Direction As Boolean
  14. Dim Stopped As Boolean
  15.  
  16. Dim Flag As Boolean
  17. Flag = 1
  18. Stopped = 0
  19. Direction = 0
  20. Data_led = &B00000001
  21.  
  22. Middle_led = 1
  23. Do
  24.    If Button = 0 Then
  25.       If Flag = 1 Then
  26.        Stopped = Not Stopped
  27.  
  28.        If Stopped = 0 Then
  29.          Direction = Not Direction
  30.        End If
  31.        Flag = 0
  32.       End If
  33.    Else
  34.       Flag = 1
  35.    End If
  36.  
  37.    If Stopped = 0 Then
  38.      If Direction = 1 Then
  39.            Rotate Data_led , Left , 1
  40.      Else
  41.            Rotate Data_led , Right , 1
  42.      End If
  43.    End If
  44.    Port_led = Data_led
  45.    Waitms 200
  46. Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement