Arama butonu
Bu konudaki kullanıcılar: 1 misafir
5
Cevap
3412
Tıklama
0
Öne Çıkarma
arduino 16x2 lcd hatası
A
10 yıl
Teğmen
Konu Sahibi

Videoyu izlemek için tıklayınız

< Resime gitmek için tıklayın >
şekildeki gibi bağlantılarımı yaptım contrast değeri 125-255 arasında videodaki görüntüleri veriyor ama test yazısını yazdırmıyor sebebi ne olabilir acaba ?

#include <LiquidCrystal.h> 
char ch;
int Contrast=125;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()
{
Serial.begin(9600);
Serial.println("LCD test with PWM contrast adjustment");
pinMode(13,OUTPUT);
analogWrite(6,Contrast);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("LCD test!!");
}

void loop()
{
digitalWrite(13,LOW);
delay(1000);
digitalWrite(13,HIGH);
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}

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(9,28836);
}
if(ch=='F')
{
analogWrite(9,0);
}
analogWrite(6,Contrast);
Serial.println("Current contrast");
Serial.println(Contrast);
}
}





< Bu mesaj bu kişi tarafından değiştirildi abdulkrm -- 29 Mart 2015; 13:39:28 >