Pages: [1]   Go Down
Author Topic: LCD not printing  (Read 231 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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();
//  } 
}
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 179
Posts: 8067
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
#include <SPI.h>
LiquidCrystal lcd(12, 11, 7, 8, 9, 10);

Pins 11, 12, and 13 are used by SPI.  Pin 10 is also important to SPI but can be used as an output pin.  Pick other pins for your LCD.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Pages: [1]   Go Up
Jump to: