Greetings
I am working on a web mail notifier. The ethernet shield connects to my server then uses "GET" to grab data. The data is then displayed on a small Nokia LCD. Currently the ethernet shield is able to accomplish this, however it outputs each character individually. Is there a way I can get all characters into a string so that they are displayed all at once?
The code im working with now:
/*
Web client
This sketch connects to a website (http://www.google.com)
using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
created 18 Dec 2009
by David A. Mellis
*///BEGIN NOKIA SCREEN SETTINGS
#include "PCD8544.h"
PCD8544 nokia = PCD8544(7, 6, 5, 4, 3);
//END NOKIA SCREEN SETUP
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1,185 };
byte server[] = { 192,168,1,23}; // Google
byte gateway[] = {192,168,1,1};
byte dns[] = {192,168,0,1};
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
Client client(server, 80);
void setup() {
//NOKIA
nokia.init();
// you can change the contrast around to adapt the display
// for the best viewing!
nokia.setContrast(55);
// turn all the pixels on (a handy test)
nokia.command(PCD8544_DISPLAYCONTROL | PCD8544_DISPLAYALLON);
delay(500);
// back to normal
nokia.command(PCD8544_DISPLAYCONTROL | PCD8544_DISPLAYNORMAL);
// show splashscreen
nokia.display();
//delay(2000);
nokia.clear();
//END NOKIA
// start the Ethernet connection:
Ethernet.begin(mac, ip);
// start the serial library:
Serial.begin(9600);
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect()) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /alertbox.php?name=mc");
client.println();
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
}
void loop()
{
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read()
//Serial.println(c,BIN);
//DISPLAY ON NOKIA - I WANT ALL CHARACTERS TO BE DISPLAYED ON THE NOKIA NOT JUST ONE AT A TIME.
// draw a string at location (0,0)
nokia.setCursor(0, 0);
nokia.print(c);
nokia.display();
delay(100);
//nokia.clear();
//END DISPLAY ON NOKIA
}
// if the server's disconnected, stop the client:
if (!client.connected()) {
nokia.setCursor(0, 0);
nokia.print("Connection Has Failed!");
nokia.display();
delay(100);
nokia.clear();
client.stop();
// do nothing forevermore:
for(;;)
;
}
}
Any help is greatly appreciated.