Node red blynk lcd widget

Before creating the topic

  1. Search forum for similar topics
  2. Check http://docs.blynk.cc and http://help.blynk.cc/
  3. Add details :
    • Hardware model + communication type. For example: Arduino UNO with Ethernet Shield
    • Smartphone OS (iOS or Android) + version
    • Blynk server or local server
    • Blynk Library version
    • Add your sketch code. :point_up:Code should be formatted as example below.

Simply paste your code between ``` If you don’t format your code, your topic can be deleted by moderators.


void loop()

And your question is?

Pete.

1 Like

the question is, why I need a loop ? :rofl:

Ah, that’s the beauty of Node-Red, you don’t need a loop!

Pete.

1 Like

i want to interface lcd widget on my blynk app with raspberry pi using node red i want to print ultrasonic sensor data on lcd widhet i am using pisrf extention on node red

I’m not familiar with pisrf, but provided it can spit out the ultrasonic data in text or numeric format then it’s very easy to push it out to the LCD widget.
Personally, I tend to use labelled display widgets as they look neater (in my opinion) and they are easier to work with.

If you’re using the LCD widget then ensure that it’s set to Advanced mode in the app.
In Node-Red use the Blynk LCD node and read through the information tab to see how to send the data to the widget.
If you’re wanting to do two lines of text (the only reason I can think of to use the LCD widget) then you’ll need to send this as msg.text and msg.text1
If you’ve previously written a long piece of data to the LCD then writing a short piece of data will leave the longer characters in place. For example, if you write “1.2345” to the widget then write “3.7” to the widget, what will actually be displayed is “3.7345”. You can get around this by writing a longer blank string first, or doing a msg.clear with the value of true.
Note that setting msg.clear to true will clear the whole display, not just one line.

Pete.

could you please send me flow to implement lcd as i am passing msg.text in function input from inject node but it is showing error while debugging.please help i just need to know how to use lcd widget

It’s not really very easy to send you something without seeing what you’ve done so far, but here’s a quick example:

image

The code in “My Function” looks like this:

msg.clear=true;
msg.text="Top row"
msg.text1="Bottom row"
return msg;

This is what the app looks like:

Pete.

1 Like

what if i want to show output from pisrf sorry but i am a total newbee to this so don’t understand the syntax of function

As I said, I have no experience of pisrf.
If you can show me some examples of a flow that gets data from pisrf and displays it in a debug node, and what that debug screen shows, then I might be able to help.

Pete.

here is the flow to show distance in debug

And what is it that you want to appear in the LCD widget?
Presumably you want more than just the numbers?

Pete.

I just want to print ditance in inches and centimeters on lcd.

Show me a mock-up of what you want the display to look like, and tell me what units (mm, cm, inches etc) the numbers coming from the Pi SRF node.

Pete.

Numbers comming from pi srf us the distance in cm. First i want to show these numbers only

Okay, I’ve put together a simple flow that simulates the data coming out of your Pi SRF node and re-formats it then outputs the results to the LCD.
The flow looks like this:

The code in My Function is like this:

var dist_cm = msg.payload; // Get the value in CM from the message payload
var dist_in = dist_cm/2.54; // Calculate what this means in inches
dist_in=dist_in.toFixed(2); // Round the inches to 2 decimal places

msg.clear=true; // Clear the old data from the LCD
msg.text=dist_cm + " Cm"; // The Cm value to the top row
msg.text1=dist_in + " Inches"; // The Inches value to the bottom row
return msg; // Output the results

The app looks like this:
image

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

However, there’s a much easier way if you don’t use the horible LCD display but use a couple of labelled value widgets instead…
image

The only function needed is to convert Cm to Inches:

msg.payload = msg.payload/2.54; // Convert CM to inches
return msg; // Output the results

image

Pete.

Thanks alot you really helped me out .
I appreciate your work

1 Like