Hi i am currently having issues using a '20,4' LCD display after i initiate 'Udp.begin(localPort)'. Rather than things i want to print to the LCD i only get squares on line 1 & 3.
This is the first set of code. This works fine as the Udp.begin(localPort) is after i've set the text.
#include <SPI.h> // needed for Arduino versions later than 0018
#include <Ethernet.h>
#include <EthernetUdp.h> // UDP library from: bjoern@cs.stanford.edu 12/30/2008
#include <LiquidCrystal.h> //LCD libary
// 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 };
IPAddress ip(192, 168, 1, 177);
unsigned int localPort = 8888; // local port to listen on
// buffers for receiving and sending data
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
char ReplyBuffer[] = "acknowledged"; // a string to send back
// An EthernetUDP instance to let us send and receive packets over UDP
EthernetUDP Udp;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
lcd.begin(20,4);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("hello world");
lcd.setCursor(0, 1);
lcd.print("hello world");
lcd.setCursor(0, 2);
lcd.print("hello world");
lcd.setCursor(0, 3);
lcd.print("hello world");
Udp.begin(localPort);
}
void loop() {}
now if i do the following with this code and move the udp section.
#include <SPI.h> // needed for Arduino versions later than 0018
#include <Ethernet.h>
#include <EthernetUdp.h> // UDP library from: bjoern@cs.stanford.edu 12/30/2008
#include <LiquidCrystal.h> //LCD libary
// 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 };
IPAddress ip(192, 168, 1, 177);
unsigned int localPort = 8888; // local port to listen on
// buffers for receiving and sending data
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
char ReplyBuffer[] = "acknowledged"; // a string to send back
// An EthernetUDP instance to let us send and receive packets over UDP
EthernetUDP Udp;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
Udp.begin(localPort);
lcd.begin(20,4);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("hello world");
lcd.setCursor(0, 1);
lcd.print("hello world");
lcd.setCursor(0, 2);
lcd.print("hello world");
lcd.setCursor(0, 3);
lcd.print("hello world");
}
void loop() {}
with this i only get blank squares. I have attached 2 photos of how it is to try and show you what i mean, Evidently both set compile fine and upload its just this one issue i've ran into.Also i have checked all the connections. are solder I cant just initiate UDP after printing to the LCD as some data that arrives over UDP needs to be displayed.
If anyone has any Idea's id greatly appriciate the help.