Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $regfile = "m8def.dat"
- $crystal = 8000000
- Config Pinb.0 = Input
- Config Pinb.1 = Input
- Config Pinb.2 = Output
- Config Pinb.3 = Output
- Config Lcd = 16 * 2
- Config Timer0 = Timer, Prescale = 1024
- On Timer0 Mult_kl
- Dim Temp1 As Byte
- Dim Temp2 As Byte
- Dim Przycisk As Byte
- Dim I As Byte
- W1 Alias Pinb.0
- W2 Alias Pinb.1
- Kol1 Alias Portb.2
- Kol2 Alias Portb.3
- Enable Interrupts
- Enable Timer0
- Load Timer0, 200
- Set Portb.0
- Set Portb.1
- Set Kol1
- Set Kol2
- Do
- Cls
- Lcd Przycisk
- Waitms 100
- Loop
- End
- Mult_kl:
- Load Timer0, 200
- For I = 1 To 2
- If I = 1 Then
- Reset Kol1
- Else
- Set Kol1
- Reset Kol2
- End If
- If W1 = 0 Or W2 = 0 Then
- Temp1 = Pinb And &B00000011
- Exit For
- Else
- Temp1 = 0
- End If
- Next I
- If Temp2 = Temp1 Then
- Przycisk = Temp1
- If I = 2 Then
- Przycisk = Przycisk + 2
- End If
- Else
- Temp2 = Temp1
- End If
- Set Kol1
- Set Kol2
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement