I am in the process of making a project where I am taking Pressure, Temperature and Humidity readings from BMP180 and DHT22 sensors respectively. I am showing these readings on three separate shift register based 4 digit seven segment displays. All is fine till now and the displays show the values correctly, but when I try to send these values to a remote http server to save in a database, I run into problems. The display digits are distorted and show random segments lighted up. The sketch is attached. Please help!
bips98:
I am in the process of making a project where I am taking Pressure, Temperature and Humidity readings from BMP180 and DHT22 sensors respectively. I am showing these readings on three separate shift register based 4 digit seven segment displays. All is fine till now and the displays show the values correctly, but when I try to send these values to a remote http server to save in a database, I run into problems. The display digits are distorted and show random segments lighted up. The sketch is attached. Please help!
Which board?
If it is a board with just 2 kB RAM like UNO, you are wasting too much RAM!
You'd better use the F-macro with the print function and all string constants.
Such like:
Serial.println("Connecting Arduino to networks...");
should become:
Serial.println(F("Connecting Arduino to networks..."));
If changing the string constants with "Serial.print" is not enough, do the same with "client.print" like:
client.print( "GET /getTemp.asp?");
change to:
client.print(F("GET /getTemp.asp?"));
Then your string constants will not need RAM memory, but only flash memory.
Flash memory in your Arduino is much bigger than RAM memory.
The normal Ethernet Shield with W5100 (or W5200) chip uses the SPI bus and pin 4 and 10.
The SPI bus is 10,11,12,13.
For your shift register you use 10,11,12,13. Those pins are for Ethernet.
You can use the analog pins as well for the shift registers. For an Arduino Uno, every analog pin can also be a digital pin.
You have many code lines with if-statements. I think the code will improve if you put that into an array with the numbers.
The code is attached as well as screen shot of the error received, you will notice that there was no error in the setup(), but the error appeared in loop()
bips98:
The code is attached as well as screen shot of the error received, you will notice that there was no error in the setup(), but the error appeared in loop()
The F-macro is ONLY for "static text" included in double quotes (literal text constants) to be used in the print() and println() functions.