Shop OBEX P1 Docs P2 Docs Learn Events
Wireless Boe-bot controller with LCD — Parallax Forums

Wireless Boe-bot controller with LCD

FRC2370FRC2370 Posts: 128
edited 2012-04-01 16:33 in General Discussion
I am waiting on the 2-axis joystick and the 2 RF transceivers to arrive to make my boe-bot wireless, and i thought I'd add a DEBUG terminal screen to the base control board, but what code do I use to make the Serial LCD 2x16 act as the DEBUG terminal??

Comments

  • bsnutbsnut Posts: 521
    edited 2012-04-01 02:04
    Welcome to the forums FRC2370.

    You have a great idea in using a LCD display as debug terminal. In order to write the code we need to know what Boe Bot that you have. So, do you have a Propeller or a Basic Stamp Boe Bot?
  • bsnutbsnut Posts: 521
    edited 2012-04-01 05:04
    Here's the PDF for the display that you have27976-7-9-ParallaxSerialLCD-v3.0.pdf, which provides you code for Boe Bot that you have.
  • FRC2370FRC2370 Posts: 128
    edited 2012-04-01 07:20
    Its a BASIC Stamp Boe-bot. Im really stumped on how to make it work as the debug terminal
  • FRC2370FRC2370 Posts: 128
    edited 2012-04-01 09:39
    Could you help with the program? I couldnt find anything in the PDF about using it as a debug terminal
  • Mike GreenMike Green Posts: 23,101
    edited 2012-04-01 09:56
    You can't use an LCD with the DEBUG statement without hacking the Board of Education, but the DEBUG statement is just a special case of the SEROUT statement and you can use that. See the example on page 3 of the documentation.
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-04-01 09:57
    Most stuff you can display with DEBUG can also be sent to the LCD, you just have to use SEROUT instead of DEBUG. You have to make sure the baud settings are correct (both in your program and on the LCD itself) or you'll get garbage on the LCD instead of what you expect.

    Like DEBUG, there are cursor positioning commands that can be sent to the LCD to control the formatting.

    Here is a program I made several years ago to use with the Parallax 2x16 back lit display.
    '{$STAMP BS2}
    '{$PBASIC 2.5}
    
    
    counter VAR Byte
    
    TxPin     CON   8            'set LCD data pin as pin 8
    Baud19200 CON   32           'set baud rate as 19200 (SEROUT 32)
    
    
    
    DEBUG CLS, "Beep Beep"      'display while speaker beeps.
    FREQOUT 10, 200, 3000        'indicates program (re)start
    PAUSE 50
    FREQOUT 10, 200, 2000
    DEBUG CLS
    
    DEBUG "PROGRAM RUNNING..."
    DEBUG CR, "Starting LCD Display"
    DEBUG CLS
    
    
    HIGH TxPin
    PAUSE 100                  'allow time for LCD to initialize
    
    SEROUT TxPin, Baud19200, [12] 'formfeed (move to 0,0 and clear display)
    PAUSE 500
    SEROUT TxPin, Baud19200, [17] 'backlight on
    PAUSE 500
    DEBUG CRSRXY, 0,0, "LCD Display"
    DEBUG CR, "initialized"
    SEROUT TxPin, Baud19200, ["LCD Display"]
    SEROUT TxPin, Baud19200, [13] 'carriage return (move to next line, position 0)
    SEROUT TxPin, Baud19200, ["Initialized"]
    PAUSE 800
    
    
    SEROUT TxPin, Baud19200, [12] 'formfeed (move to 0,0 and clear display)
    PAUSE 50
    DEBUG CLS
    DEBUG CRSRXY,0,0, "Flashing light"
    DEBUG CR, "on LCD display"
    SEROUT TxPin, Baud19200, ["Flashing light"]
    SEROUT TxPin, Baud19200, [13] 'carriage return (move to next line, position 0)
    SEROUT TxPin, Baud19200, ["on LCD display"]
    PAUSE 500
    
    FOR counter = 1 TO 10
      SEROUT TxPin, Baud19200, [18] 'backlight off
      PAUSE 500
      SEROUT TxPin, Baud19200, [17] 'backlight on
      PAUSE 500
    
    NEXT
    
      SEROUT TxPin, Baud19200, [12] 'formfeed (move to 0,0 and clear display)
      PAUSE 50
      DEBUG CLS
      DEBUG CRSRXY,0,0, "Changing to"
      DEBUG CR, "flash loop"
      SEROUT TxPin, Baud19200, ["Changing to"]
      SEROUT TxPin, Baud19200, [13] 'carriage return, move to next line, position 0
      SEROUT TxPin, Baud19200, ["flash loop"]
      PAUSE 1000
    
    
      SEROUT TxPin, Baud19200, [12] 'formfeed (move to 0,0 and clear display)
      PAUSE 100
      DEBUG CLS
      DEBUG CRSRXY,0,0, "Running light"
      DEBUG CR, "flash loop"
      SEROUT TxPin, Baud19200, ["Running light"]
      SEROUT TxPin, Baud19200, [13] 'carriage return (move to next line, position 0)
      SEROUT TxPin, Baud19200, ["flash loop"]
      PAUSE 500
    
    
    DO
    
     SEROUT TxPin, Baud19200, [18] 'backlight off
     PAUSE 500
    
     SEROUT TxPin, Baud19200, [17] 'backlight on
     PAUSE 2000
    
     SEROUT TxPin, Baud19200, [18] 'backlight off
     PAUSE 500
    
     SEROUT TxPin, Baud19200, [17] 'backlight on
     PAUSE 1000
    
    LOOP
    
  • FRC2370FRC2370 Posts: 128
    edited 2012-04-01 15:35
    So what code would I need to use the LCD as the debug terminal with SEROUT?
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-04-01 15:59
    There is no magic code, the LCD displays what you send to it, just like DEBUG does. The only real difference is you have to specify the Pin and the Baudrate. You really need to read the documentation for the LCD display and also all the information in the Basic Stamp Editor Help files about the SEROUT command.

    DEBUG "Message Here"

    SEROUT Pin, Baudrate, ["Message Here"]

    If the LCD is set to 9600 and connected to pin 8 on a Basic Stamp 2, then it would look like this:


    SEROUT 8, 84, ["Message Here"]
  • FRC2370FRC2370 Posts: 128
    edited 2012-04-01 16:33
    Alright thanks, this was a big help
Sign In or Register to comment.