So I have this problem, in my code i want to show the values on a lcd, and on the serial monitor.
But when I add the "Serial.begin(9600);" The lcd starts to display weird tokens and sometimes does nothing.
.
So it is serial monitor OR lcd.
But I want both.
I tested the display with the code that i got from the Arduino Projects book, then the dispay works fine, (even with the other pins than in the original code)
This is my example code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(0, 1, 5, 4, 3, 2);
int count = 1 ;
void setup() {
Serial.begin(9600); //If I leave this line in, it can show it on on serial monitor, but not on the lcd.
//If I remove the line it will only show the numbers on the lcd, not on the serial monitor.
lcd.begin(16, 2);
lcd.clear() ;
delay(2000) ;
}
void loop() {
Serial.print(count++) ;
Serial.println() ;
lcd.home();
lcd.print(count);
lcd.setCursor(0, 1);
lcd.print(count);
delay(2000) ;
}