I'm new so I might be making a stupid mistake, but I'm declaring:
char dollars;
at the begging of file, afterwards I'm reading a data from a web page, printing it to my serial. That part work well. The data returned from the web page is a number, 55 for instance.
The number get's printed correctly to the serial. But when I try to save the complete number it changes. for instance, when I get 0 from the server. The printed result is 10.
here is the important part of my code:
unsigned long lastRead = millis();
while (www.connected() && (millis() - lastRead < IDLE_TIMEOUT_MS)) {
while (www.available()) {
char c = www.read();
Serial.print(c);
dollars = www.read();
lastRead = millis();
}
}
www.close();
Serial.println(dollars);
while the www.read is repeating each of the returned characters it works fine Serial.print(c); but when I save it to the dollars char var, it get garbled up into something different. What am I doing wrong?
I'm planning to show that number from the web page onto my 4 digit screen at the end.