Shop OBEX P1 Docs P2 Docs Learn Events
Parallax Serial LCD Driver v1.2 — Parallax Forums

Parallax Serial LCD Driver v1.2

xanaduxanadu Posts: 3,347
edited 2012-03-03 16:21 in Propeller 1
I have a question about this object. I'm trying to use it and I was wondering what this does -
PUB init(pin, baud, lines): okay

'' Qualifies pin, baud, and lines input
'' -- makes tx pin an output and sets up other values if valid

  started~                                              ' clear started flag
  if lookdown(pin : 0..27)                              ' qualify tx pin 
    if lookdown(baud : 2400, 9600, 19200)               ' qualify baud rate setting
      if lookdown(lines : 2, 4)                         ' qualify lcd size (lines)
        if serial.init(-1, pin, baud)                   ' tx pin only, true mode
          lcdLines := lines                             ' save lines size
          started~~                                     ' mark started flag true

  return started

Am I supposed to modify pin, baud and lines to the settings I use, or is that somewhere else?

Thanks!

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2012-03-03 15:47
    You have to call init with the settings you want. No change in the objects code itself!

    What you see in that code are only the valid values.
  • xanaduxanadu Posts: 3,347
    edited 2012-03-03 16:21
    Like this?
    obj
    
    serial_lcd : "serial_lcd"
    
    pub main
            
    serial_lcd.init(23,19200,2)
    

    Thanks
Sign In or Register to comment.