I have a tricky question.
Suddenly my LCD03 only displays “Serialmode”.
Yesterday everything worked ok but today it doesn’t. I’m tearing my hair of in frustration.
I compile the code and upload it using the USB-interface.
HW and used ports
• Arduino Uno board
• LCD03 (in serial mode) connected to pins 2(rx) 3(tx) port
• IR Remote Control connected to pin 11
• MD3 Motor Controller connected to A4 (SDA), A5 (SCL)
• AttoPilot Volt & Cur. BoB 90A connected to the digital A0 and A1
#define LCD_RX 0x02 // Arduino pin for rx #define LCD_TX 0x03 // Arduino Pin for tx #define LCD03_HIDE_CUR 0x04 // Stops the position cursor from appearing on the display #define LCD03_CLEAR 0x0C // Clears the screen and sets cursor to the home position #define LCD03_RETURN 0x0D // Carriage Return #define LCD03_SET_CUR 0x01 // Cursor to a position specified by the next byte, where 1 is the top left and 80/32 is the bottom right #define LCD03_BACKLIGHT_ON 0x13
.
SoftwareSerial lcd_03 = SoftwareSerial(LCD_RX, LCD_TX); // Sets up serial for LCD03
.
void setup()
{
Serial.begin(14400);
Wire.begin(); //i2c comunication with motor set up
delay(100);
irrecv.enableIRIn(); // Start the receiver
delay(100);
setUpLcd(); // Initiate LCD
delay(100);
}
void loop(){
if (irrecv.decode(&results)) //Wait for input from IR-Remote
{
translateIR(); //Analyze result from IR-Remote, detarmine pressed button
readAmpVolt();
writeToLcd();
irrecv.resume();
}
}
void setUpLcd(){
lcd_03.write(LCD03_SET_CUR);
lcd_03.write(LCD03_BACKLIGHT_ON); // Turn on LCD light
lcd_03.begin(9600); // Begin serial for LCD03
lcd_03.write(LCD03_HIDE_CUR); //Hides LCD03 cursor
lcd_03.write(LCD03_CLEAR); //Clears LCD03 screen
lcd_03.write(LCD03_BACKLIGHT_ON);
}