LOGIN
Steven Reubenstone
34
Community Expert
Mechanical Engineer & Tinkerer of Things. (Project Leader)
 · New YorkU.S.
Share
Report
Get Link
TASK
Open
Reward › Contribution Review

New Task: Write Script to Display Events on LCD Properly

Contributions
Anas Dalintakam

Anas is the greatest mentor ever. I am very excited that he helped me understand how to write my Arduino Program so that I can properly have my LCD readout live data, vs. static data from my http call. Now on to the next step in my project!

Arduino Uno

1 like 
Like
Award Contribution
Load 4 previous comments
Steven Reubenstone
34
Community Expert
Mechanical Engineer & Tinkerer of Things. (Project Leader)
 · New YorkU.S.
Share
Report
Get Link

No, not yet. I have only begun to sketch out how to do this (because we need to create web api first). It will be helpful to me if I can still understand the full LCD part first.

How would we best store that data we get from server? In what type of element – an object? Could you give example?

Like
0 like 
Award Contribution
Anas Dalintakam
2
Apprentice
Electronics engineer,DIY thinkerer,arduino/raspberry pi/particle enthusiast,IoT researcher
 · BengaluruIndia
Share
Report
Get Link

please check this example
https://circuits.io/circuits/2908404-lcd-analog-voltage-display
In that you can see that i am storing the voltage value as integer.Like that you have to store data in string/int that should be printed in lcd .

// #include <LiquidCrystal.h>


// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
 // set up the LCD's number of columns and rows:
 lcd.begin(16, 2);
 // Print a message to the LCD.
 lcd.print("wiring it my way");
}

void loop() {
 // set the cursor to column 0, line 1
 // (note: line 1 is the second row, since counting begins with 0):
 lcd.setCursor(0, 1);
 
 int value=analogRead(A0);
 // print the number of seconds since reset:
 lcd.print(value);
}
Like
1 like 
Award Contribution
Anas Dalintakam
2
Apprentice
Electronics engineer,DIY thinkerer,arduino/raspberry pi/particle enthusiast,IoT researcher
 · BengaluruIndia
Share
Report
Get Link

check how how i stored “value” and then printed

Like
1 like 
Award Contribution
Steven Reubenstone
34
Community Expert
Mechanical Engineer & Tinkerer of Things. (Project Leader)
 · New YorkU.S.
Share
Report
Get Link

Great help…I am getting closer.

so here

int value=analogRead(A0);
// print the number of seconds since reset:
lcd.print(value);

You are reading data from an active input (the analog input). That makes sense.

However in the case of reading from an http request…that request is receiving data from a loop so it would be like

loop 1

// http request: get newest Event

loop 2

lcd print (event)

**Will “event” be fresh data in loop 2? I am curious if loop2 will update based on the loop 1.

Arduino Uno

Like
0 like 
Award Contribution
Anas Dalintakam
2
Apprentice
Electronics engineer,DIY thinkerer,arduino/raspberry pi/particle enthusiast,IoT researcher
 · BengaluruIndia
Share
Report
Get Link

either you can write lcd.print in same loop under http actions .or you can write functions and call in void loop

//
void setup(){
}
void loop(){
http()
lcd()
}
void http(){
}

void lcd(){
}

like this

Like
1 like 
Award Contribution
Steven Reubenstone
34
Community Expert
Mechanical Engineer & Tinkerer of Things. (Project Leader)
 · New YorkU.S.
Share
Report
Get Link

Understood wow – simple – yet not obvious. I appreciate your help here greatly. I am adding you as a contributor.

Like
0 like 
Award Contribution
JOIN TASK
LEAVE A REPLY
DISCOVER
CHAT
ALERTS
DISCUSSIONS
FEED
New Post
Facebook Share
Share Link
Help