How to print variable on arduino LCD screen.
Go to solution
Solved by fizzlesticks,
edit 2: The strange character is the arduino trying to print 'enter'. I don't know how to stop that.
Just check for a newline character and ignore it.
#include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); char c = 'c'; void setup() { lcd.setCursor(0, 0); Serial.begin(9600); lcd.begin(16,2); lcd.clear(); } void loop() { while(Serial.available() == 0); char dMes = Serial.read(); if(dMes == c){ lcd.clear(); lcd.setCursor(0,0); } else if(dMes != '\n'){ lcd.print(dMes); } delay(30); }
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now