Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OBJ
- LCD : "FullDuplexSerial.spin"
- CON
- _clkmode = xtal1 + pll16x
- _xinfreq = 5_000_000
- TxPin = 0
- PUB Main
- dira[1..5]~ ' Pins 0-4 to input
- LCD.start(TxPin, TxPin, %1000, 9600)
- WaitCnt(ClkFreq + Cnt) ' Pause to initialize
- LCD.tx(12) ' Clear
- LCD.tx(17) ' Turn on backlight
- repeat
- if ina[1] == 0
- LCD.tx(12)
- LCD.Str(String("Down"))
- if ina[2] == 0
- LCD.tx(12)
- LCD.Str(String("Left"))
- if ina[3] == 0
- LCD.tx(12)
- LCD.Str(String("Center"))
- if ina[4] == 0
- LCD.tx(12)
- LCD.Str(String("Right"))
- if ina[5] == 0
- LCD.tx(12)
- LCD.Str(String("Up",13))
- WaitCnt(ClkFreq + Cnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement