Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $regfile = "m8def.dat"
- $crystal = 8000000
- $hwstack = 40
- $swstack = 16
- $framesize = 32
- Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.3 , Db6 = Portc.4 , Db7 = Portc.5 , E = Portc.1 , Rs = Portc.0
- Config Portb.1 = Input , Portb.0 = Input
- Config Portb.3 = Input
- Config Portb.2 = Input
- Portb.1 = 1
- Portb.2 = 1
- Portb.3 = 1
- Config Lcd = 16 * 2
- Deflcdchar 0 , 32 , 24 , 24 , 6 , 5 , 4 , 10 , 5 ' lewo
- Deflcdchar 1 , 32 , 3 , 3 , 12 , 20 , 4 , 10 , 20 ' prawo
- Deflcdchar 2 , 32 , 24 , 24 , 6 , 5 , 4 , 10 , 10 ' lewo ruh
- Deflcdchar 3 , 32 , 3 , 3 , 12 , 20 , 4 , 10 , 10 ' prawo ruh
- Deflcdchar 4 , 6 , 6 , 4 , 14 , 21 , 4 , 10 , 10 ' centrum
- 'Deflcdchar 0 , 14 , 17 , 17 , 14 , 21 , 14 , 4 , 10
- 'Deflcdchar 1 , 14 , 17 , 17 , 14 , 4 , 14 , 21 , 10
- 'Deflcdchar 0 , 32 , 14 , 31 , 21 , 31 , 10 , 21 , 32
- 'Deflcdchar 1 , 32 , 14 , 31 , 21 , 31 , 21 , 10 , 32
- Cursor Off Noblink
- Cls
- Dim Pozycja As Byte
- Pozycja = 7
- Dim I As Byte
- Dim Wysokosc As Bit
- Wysokosc = 0
- Dim X As Byte
- X = 0
- Dim Ona As Byte
- Ona = 0
- Lowerline
- Lcd Chr(4)
- For I = 1 To Pozycja
- Shiftlcd Right
- Next
- Wait 3
- Do
- Cls
- If Pinb.3 = 0 And Pozycja =< 15 Then
- Pozycja = Pozycja + 1
- Ona = 1
- If X = 0 Then
- X = 1
- Else
- X = 0
- End If
- End If
- If Pozycja > 15 Then
- Pozycja = 0
- End If
- If Pinb.1 = 0 And Pozycja = 0 Then
- Pozycja = 0
- Pozycja = 16
- End If
- If Pinb.1 = 0 And Pozycja > 0 Then
- Pozycja = Pozycja - 1
- Ona = 0
- If X = 0 Then
- X = 1
- Else
- X = 0
- End If
- End If
- If Pinb.2 = 0 Then
- If Wysokosc = 0 Then
- Wysokosc = 1
- Else
- Wysokosc = 0
- End If
- If X = 0 Then
- X = 1
- Else
- X = 0
- End If
- End If
- If Wysokosc = 1 Then
- Upperline
- Else
- Lowerline
- End If
- If Ona = 0 And X = 0 Then
- Lcd Chr(0)
- End If
- If Ona = 0 And X = 1 Then
- Lcd Chr(2)
- End If
- If Ona = 1 And X = 0 Then
- Lcd Chr(1)
- End If
- If Ona = 1 And X = 1 Then
- Lcd Chr(3)
- End If
- For I = 1 To Pozycja
- Shiftlcd Right
- Next
- Waitms 100
- Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement