Advertisement
Atdiy

Basic LCD

Jul 29th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 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.  
  12. LCD.start(TxPin, TxPin, %1000, 9_600)
  13. WaitCnt(ClkFreq / 100 + Cnt) ' Pause to initialize
  14. LCD.tx(12) ' Clear
  15. LCD.tx(17) ' Turn on backlight
  16. LCD.str(String("Hello, world...")) ' First line
  17. LCD.tx(13) ' Line feed
  18. LCD.str(String("from Parallax!")) ' Second line
  19. LCD.tx(212) ' Set quarter note
  20. LCD.tx(220) ' A tone
  21. WaitCnt(ClkFreq * 3 + Cnt) ' Wait 3 seconds
  22. LCD.tx(18) ' Turn off backlight
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement