LCD Commands not working - ERROR: LCD is not initialized!

JwolfJwolf Posts: 7
Hello, I decided to try out Blockly for the first time and am using the same Parallax 4x20 LCD (Back Light + sound) I've used on many other SPIN projects.
Using 'Communicate-> Serial LCD', I have put in 'serial lcd initialize' with the proper pin#, and It will display proper text and variables via 'serial lcd print'...
But I cannot get any 'Serial LCD Command' to work.
I have tried every Command available on the list, but when I compile and look at the code, it says " // ERROR: LCD is not initialized! "

http://blockly.parallax.com/blockly/projectlink?id=63490&key=965d7f4a-07a5-406f-bc4f-f3940c4f0f2d
Please help, I cannot clear screen or even do a carriage return!

Comments

  • 5 Comments sorted by Date Added Votes
  • laurent974laurent974 Posts: 66
    edited November 1 Vote Up0Vote Down
    When i look at the translated code in C and i compared to the one available @ the learn site here
    learn.parallax.com/tutorials/language/propeller-c/propeller-c-simple-protocols/half-duplex-serial:

    there are several differences:
    - The baud is not the same (but i suppose you configured correctly the switches.)
    - an this is not present in your code.
     writeChar(lcd, ON);
      writeChar(lcd, CLR);
    

    Try the code at the learn site and search what is not working.

    [Edit]

    in blocky try to add the block :
    send serial LCD command : display on, cursor on. (untested for me)
  • Yes the Baud is correct. text and variables print correctly on the LCD, its just the commands that do not work.
    Instead of Blockly putting in code, it puts in "// ERROR: LCD is not initialized!"
  • Thanks for finding this - I'll see if I can get it fixed ASAP.
    Matthew Matz
    STEM/Robotics Educator
    Parallax Inc.
  • I found the problem, and it is for sure a bug. I think I can squeeze a fix in before the next release which is coming very soon. For now, one option is to send ASCII characters to the screen.

    Here's what that command block is sending:
    ["clear screen", "12"],
    ["move cursor right", "9"],
    ["move cursor left", "8"],
    ["move cursor down", "10"],
    ["carriage return", "13"],
    ["backlight on", "17"],
    ["backlight off", "18"],
    ["display off", "21"],
    ["display on, cursor off", "22"],
    ["display on, cursor off, blink", "23"],
    ["display on, cursor on", "24"],
    ["display on, cursor on, blink", "25"]

    If you use the serial LCD print multiple block and configure it to just send characters, that will work until this gets fixed.
    Matthew Matz
    STEM/Robotics Educator
    Parallax Inc.
  • Thank you!
Sign In or Register to comment.