LOGIN
Steven Reubenstone
Mechanical Engineer & Collaborizm Mentor. Join our iOT Hackathon! (Project Leader)
 · New YorkU.S.
Edit
Delete
Share
Report
TASK
Open
  ·  Close Task

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

added by:   Steven Reubenstone
1 like 
Like
Share
Load 4 previous comments
Steven Reubenstone
Mechanical Engineer & Collaborizm Mentor. Join our iOT Hackathon! (Project Leader)
 · New YorkU.S.
Edit
Delete
Share
Report

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?

0 like 
Anas Dalintakam
Electronics engineer,DIY thinkerer,arduino/raspberry pi/particle enthusiast,IoT researcher
 · KozhikodeIndia
Edit
Delete
Share
Report

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:
~span~class~_1bcRJhiNTH8jh88VODldlE~#include~span~ <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);
}
1 like 
Anas Dalintakam
Electronics engineer,DIY thinkerer,arduino/raspberry pi/particle enthusiast,IoT researcher
 · KozhikodeIndia
Edit
Delete
Share
Report

check how how i stored “value” and then printed

1 like 
Steven Reubenstone
Mechanical Engineer & Collaborizm Mentor. Join our iOT Hackathon! (Project Leader)
 · New YorkU.S.
Edit
Delete
Share
Report

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

0 like 
Anas Dalintakam
Electronics engineer,DIY thinkerer,arduino/raspberry pi/particle enthusiast,IoT researcher
 · KozhikodeIndia
Edit
Delete
Share
Report

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

1 like 
Steven Reubenstone
Mechanical Engineer & Collaborizm Mentor. Join our iOT Hackathon! (Project Leader)
 · New YorkU.S.
Edit
Delete
Share
Report

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

0 like 
Leave a reply...
DISCOVER
CHAT
ALERTS
-2
DISCUSSIONS
-1
FEED