Advertisement
Atdiy

LCDandSwitchv0.02

Jul 29th, 2012
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. OBJ
  2.  
  3. LCD : "FullDuplexSerial.spin"
  4.  
  5. CON
  6. _clkmode = xtal1 + pll16x
  7. _xinfreq = 5_000_000
  8. TxPin = 0
  9.  
  10. PUB Main
  11. dira[1..5]~ ' Pins 0-4 to input
  12. LCD.start(TxPin, TxPin, %1000, 9600)
  13. WaitCnt(ClkFreq + Cnt) ' Pause to initialize
  14. LCD.tx(12) ' Clear
  15. LCD.tx(17) ' Turn on backlight
  16. repeat
  17. if ina[1] == 0
  18. LCD.tx(12)
  19. LCD.Str(String("Down"))
  20. if ina[2] == 0
  21. LCD.tx(12)
  22. LCD.Str(String("Left"))
  23. if ina[3] == 0
  24. LCD.tx(12)
  25. LCD.Str(String("Center"))
  26. if ina[4] == 0
  27. LCD.tx(12)
  28. LCD.Str(String("Right"))
  29. if ina[5] == 0
  30. LCD.tx(12)
  31. LCD.Str(String("Up",13))
  32. WaitCnt(ClkFreq + Cnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement