Shop OBEX P1 Docs P2 Docs Learn Events
LCD Commands not working - ERROR: LCD is not initialized! — Parallax Forums

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

JwolfJwolf Posts: 74
edited 2018-10-31 07:40 in Learn with BlocklyProp
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

  • laurent974laurent974 Posts: 77
    edited 2018-11-01 10:48
    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.
  • 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.
  • Thank you!
Sign In or Register to comment.