Hi guys,
I have a problem.. I am in a bit of crunch due to work and I can't find the solution to my problem elsewhere so I thought I should ask the nice folks here on the Arduino Forum. I am using an Arduino Ethernet and I am able to display messages on the screen no problem as long as I don't have to do anything else.
The goal is to have a webserver that responds to user input and prints messages on the screen. I have posted a basic example of what I am doing below, full example is too long to post here.
The issue: You can see I have basic server code commented out and as soon as I uncomment any of it, the LCD function lcd.print() does not work anymore and no text is displayed. Can anyone please help me understand why this is happening and what I can do to avoid this!
#include <SPI.h>
#include <Ethernet.h>
#include <LiquidCrystal.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 };
LiquidCrystal lcd(12, 11, 7, 8, 9, 10);
int backLightPin = 2;
char n = 0; // n used for nfc varification, 1=enable, 0=disabled
char s = 0; // s is used for holding scenario number set by teller app
char p[] = {'0','0','.','0','0'}; // price set by teller app
int priceLength = 0;
//char data[200];
IPAddress ip(192,168,0,95);
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);
void setup() {
Serial.begin(9600);
//setupServer();
setupLCD();
}
void setupLCD() {
lcd.begin(16, 2);
//setup pin 2 to control backlight
pinMode(backLightPin, OUTPUT);
//turn on backlight
digitalWrite(backLightPin, HIGH);
// lcd.clear();
lcd.noDisplay();
}
void setupServer() {
Ethernet.begin(mac);
server.begin();
// Serial.print("server is at ");
// Serial.println(Ethernet.localIP());
// set up the LCD's number of columns and rows:
}
void loop() {
lcd.setCursor(3,0);
lcd.print("Ready");
delay(10000);
// EthernetClient client = server.available();
// if (client) {
// while (client.connected()) {
// if (client.available()) {
//
//
// }
// }
// delay(1);
// client.stop();
// }
}