Issue with writing LCD in my function
tomcrawford
Posts: 1,129
If I initialize an LCD in my main program and try to write to it in a function, I get this
Compile... Failed! -------- compiler messages -------- Included libraries: simpletools single.c: In function 'DispLCD': single.c:54:13: error: 'debug_lcd' undeclared (first use in this function) single.c:54:13: note: each undeclared identifier is reported only once for each function it appears in
Comments
Are you using Blockly or Simple IDE. Can you cut & paste the "C" code into code blocks so if blockly we can see how blockly is translating into c (what's being declared & where.)
Tom M.
Edit: The lcd is getting connected; I can write to it from main().
Tom M
I tried running debug_lcd in a new cog and initializing in the new cog. Same problem; the initializing statement shows up in main.
I tried printing to debug_lcd in main (without a separate function) and it worked.
Tom M
For example for a bluetooth device that I am going to call in a function or use in a separate cog I will: I think that Blockly needs to do the same.
Tom M
Blockly folks, I think this is a pretty serious restriction. What do I have to do to get this on the "to-fix" list?
Thanks for bringing this up. The best way to get any bug or enhancement on our radar is to post it to the Parallax GitHub issues list for that project. This one would go to:
https://github.com/parallaxinc/BlocklyProp/issues/
I went ahead and posted this one as an example:
https://github.com/parallaxinc/BlocklyProp/issues/1391
...and encourage you to join and submit if you find any more issues.
Thanks again, Andy