Hello,
I am new to this arduino programming and i need a bit of help with the loop statement. I am trying to get the data from text file to display on the lcd connecting to arduino yun. Which I got it to work.
Problem is as i update the text file the ardunio still displays the old results on lcd until i hit "upload" from the ide.
I want to make it so that it refreshes everytime i update the text file or refresh at certain interval like 5 seconds.
any help is appreciated
below is my code
#include <Bridge.h>
#include <HttpClient.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);
void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Bridge.begin();
Serial.begin(9600);
display.begin();
display.setContrast(50);
display.clearDisplay();
loop();
display.display();
display.clearDisplay();
}
void loop (){
HttpClient client;
client.get("http://testsite.ucoz.net/data.txt");
while (client.available()) {
char c = client.read();
display.print(c);}
}