Go Down

Topic: Changing Parameters In Your Code using a LCD Screen and No uploading (Read 442 times) previous topic - next topic


I am wondering the feasibility of a certain project. I have code that sends data to the internet. I am connected through a WIFI shield. However, currently, if I want to change networks or the http request to where I send my data, Ill have to do it in the code through a cable and a computer that has the Arduino software n it so I can adjust the code. Is there a way to have an LCD display screen and push buttons be able to change the  following?

Code: [Select]
char server[] = "xx.com"; 
char ssid[] = "xx";     //SSID Home Network Name
char pass[] = "xx";  //Key or Network Password

client.print(F("GET http://.php?"))
client.println("Host: http:// com/");

The client.print is inside a function that gets called with the time alarm library every 10 minutes. The server[], ssid[], and pass[] is before my Setup.  To give an example, I have my little device (lets say it's a weather station) and at first I am able to send data to the internet successfully at my house. Then, I go to a place with a different network, and the server I am hosting my files on is down permanently. There in no computer where I am at but only internet connection. I got a different hosting place on the web. I need to use the LCD display screen  and push buttons to change the server, ssid, pass, GET, and Host in my code without uploading a new program. Can this be done? Thanks for your time


On most Arduinos there is an area of memory that is preserved across power cycles and downloads of the software, called EEPROM.  You could read the previous values into your code to use for the network, and if a button is pressed, update the information.  It depends on what is your actual microprocessor, how much EEPROM space is available.  The Uno for instance has 1K (1,024) bytes, the Leonardo has 1K, the Mega 2560 has 4K, the Due has no EEPROM, and ATtiny85 based systems like 512 bytes: http://arduino.cc/en/Reference/EEPROM

Now, if you only have 4 arrow keys, it can be rather tedious to enter in all of the information (much like pre-smartphone text input), but I imagine that you only need to do the setup occasionally.

Go Up