I'm trying to use a Teensy3.5 with a LCD (WM-C1602M), but I just get the fist line with black squares and the second empty. It was working with my arduino. Do I need some resistor?
LCD doors sequence:
GND 5V GND D4 GND(constrast pin) D5 (4 in the center with nothing) D6 D7 D8 D29 D30 GND
CODE:
#include <LiquidCrystal.h>
char ch;
int Contrast = 15;
LiquidCrystal lcd(4, 5, 6, 7, 8, 29);
void setup(){
Serial.begin(9600);
lcd.begin(16, 2);
lcd.print("FIRST LINE");
}
void loop(){
lcd.setCursor(0, 1);
lcd.print("SECOND LINE");
}
void serialEvent(){
if (Serial.available()){
ch = Serial.read();
if (ch == 'A' && Contrast < 255)
{
Contrast = Contrast + 1;
}
if (ch == 'B' && Contrast > 0)
{
Contrast = Contrast - 1;
}
if (ch == 'N')
{
analogWrite(30, 28836);
}
if (ch == 'F')
{
analogWrite(30, 0);
}
Serial.println("Current contrast");
Serial.println(Contrast);
}
}
LCD doors sequence:
GND 5V GND D4 GND(constrast pin) D5 (4 in the center with nothing) D6 D7 D8 D29 D30 GND
CODE:
#include <LiquidCrystal.h>
char ch;
int Contrast = 15;
LiquidCrystal lcd(4, 5, 6, 7, 8, 29);
void setup(){
Serial.begin(9600);
lcd.begin(16, 2);
lcd.print("FIRST LINE");
}
void loop(){
lcd.setCursor(0, 1);
lcd.print("SECOND LINE");
}
void serialEvent(){
if (Serial.available()){
ch = Serial.read();
if (ch == 'A' && Contrast < 255)
{
Contrast = Contrast + 1;
}
if (ch == 'B' && Contrast > 0)
{
Contrast = Contrast - 1;
}
if (ch == 'N')
{
analogWrite(30, 28836);
}
if (ch == 'F')
{
analogWrite(30, 0);
}
Serial.println("Current contrast");
Serial.println(Contrast);
}
}