Can't show ultrasonic sensor values on 1602 LCD


#1

I am trying to make a digital ruler with a screen but whatever I do, mBlock doesn’t upload the code if I try to print the ultrasonic sensor’s value on screen using a variable. I have looked at other example projects on forums and YouTube but they don’t really work with my type of LCD or they code it using mBlock 3 and it just works there I guess.

Before anyone suggests, I know I can just make it on Arduino IDE but it is required for a weekly project for a robotics course, and I am teaching a group of 2nd to 5th graders in Turkey so they can’t write the code themselves, they are comfortable working with mBlock 5 at this point. Also, I can’t use I2C module or and LCD that comes soldered with the module because my students don’t have that version.

mBlock%205%20Code

Thanks in advance.


#2

@Gurfield It looks like the issue would be with the LCD screen extension you are using. Try a couple others, and contact makeblock or the extension developers about the issue. Not much I can do, sorry. :confused: (If you have the Arduino IDE code, I might be able to make an extension based on it.)


#3

Thank you so much :smile: , I haven’t actually tried another extension thinking I must have done something wrong. Changing to a different extension fixed it immediately.


#4

@Gurfield No problem! Just be aware that most extensions (especially LCD, it seems!) are usually non-functional. So if you get an error related to an extension, you will need to remove the extension and sometimes restart mBlock (after saving your project, of course!) and try another. Good luck!