Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. $regfile = "m8def.dat"
  2. $crystal = 8000000
  3.  
  4. Config Pinb.0 = Input
  5. Config Pinb.1 = Input
  6. Config Pinb.2 = Output
  7. Config Pinb.3 = Output
  8. Config Lcd = 16 * 2
  9. Config Timer0 = Timer, Prescale = 1024
  10.  
  11. On Timer0 Mult_kl
  12.  
  13. Dim Temp1 As Byte
  14. Dim Temp2 As Byte
  15. Dim Przycisk As Byte
  16. Dim I As Byte
  17.  
  18. W1 Alias Pinb.0
  19. W2 Alias Pinb.1
  20. Kol1 Alias Portb.2
  21. Kol2 Alias Portb.3
  22.  
  23. Enable Interrupts
  24. Enable Timer0
  25. Load Timer0, 200
  26.  
  27. Set Portb.0
  28. Set Portb.1
  29. Set Kol1
  30. Set Kol2
  31.  
  32. Do
  33. Cls
  34. Lcd Przycisk
  35. Waitms 100
  36. Loop
  37. End
  38.  
  39. Mult_kl:
  40. Load Timer0, 200
  41. For I = 1 To 2
  42. If I = 1 Then
  43. Reset Kol1
  44. Else
  45. Set Kol1
  46. Reset Kol2
  47. End If
  48. If W1 = 0 Or W2 = 0 Then
  49. Temp1 = Pinb And &B00000011
  50.  
  51. Exit For
  52. Else
  53. Temp1 = 0
  54. End If
  55. Next I
  56. If Temp2 = Temp1 Then
  57. Przycisk = Temp1
  58. If I = 2 Then
  59. Przycisk = Przycisk + 2
  60.  
  61. End If
  62. Else
  63. Temp2 = Temp1
  64. End If
  65. Set Kol1
  66. Set Kol2
  67. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement