Hi!
I'm trying to write some text to an lcd 1602 from console on linux but with no success.
First, this code works, so I know it's wired properly:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int switchPin = 6;
void setup() {
// put your setup code here, to run once:
lcd.begin(12, 2);
pinMode(switchPin, INPUT);
lcd.setCursor(0, 0);
lcd.print("Hello");
}
Now I'm trying to print stuff with this code on the Arduino:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int switchPin = 6;
void setup() {
lcd.begin(12, 2);
pinMode(switchPin, INPUT);
lcd.setCursor(0, 0);
lcd.print("Hello");
}
void loop() {
char testData;
if(Serial.available() )
{
testData = Serial.read();
lcd.print(testData);
}
}
And in the console in linux I type :
echo "Hello!" > /dev/ttyACM0
Something is happening because the screen displays a line of squares and then nothing.
I'm not sure what to do to display text, I'm sorry if this is perhaps linux related more than Arduino. Can someone point me in the right direction please?
I have to add that my initial intention was to print from within puredata, I tried with [comport] with no success (although the RX led was blinking each time I sent some data), so I then went to try and see if it worked from console