Friday 10 May 2019

Arduino ile Nokia 5110 Ekran Bağlantısı


Arduino ile Nokia 5110 Ekran Bağlantısı

Arkadaşlar bu yazımız da sizlere Arduino ile Nokia 5110 ekran bağlantısı yapıyoruz.
İlk başta bilgisayarınızdaki Arduino IDE’yi açın ve Arduino’nuzu bilgisayarınıza 
bağladıktan sonra Araçlar menüsünden uygun panoyu seçin.


Adafruit kitaplığına GitHub linkinden kütüphaneyi ekleyiniz.

Zip dosyası indirildikten sonra Sketch -> Include Library -> Add. ZIP kütüphanesini 
seçin ve ZIP’ın indirildiği yere gözatın.
Şimdi Dosya -> Örnekler -> Adafruit PCD Nokia 5110 LCD Kütüphanesi -> pcdtest’i 
seçerek örnek programını açın ve yükleme düğmesine tıklayın
48X48 Şeklinde paintten Görüntüyü yeniden boyutlandırdıktan sonra, Paint’deki Farklı Kaydet 
seçeneğini kullanarak görüntüyü bitmap olarak kaydedin (siyah beyaz) . Görüntüyü LCD ekranda 
bir bitmap olarak görüntülemek için, bitmap görüntüsünü koda dönüştürebilecek bir 
yazılıma ihtiyacımız olacak
Arduino kodu aşağıdaki gibidir.
// pinler şekildeki gibi
//     RST  – Pin 3
//      CE   – Pin 4
//      DC   – Pin 5
//      DIN  – Pin 6
//      CLK  – Pin 7
#include
Nokia5110 glcd(3,4,5,6,7);
/* Aşşagıdakı kısma dönüşüm yaptıgınız logonun kodlarını yazınız */
const char Logo [504] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xe0, 0xf0, 0xf0, 0xf8, 0x7c, 
0x7c, 0x3e, 0x1c, 0x8c, 0xc8, 0xc0, 0xe0, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x18, 0x1c, 0x3c, 0x7e, 0xff, 0xff, 0xff, 0xe7, 0xe3, 0xc3, 0x89, 0x98, 0x3c, 0x3e,
 0x1e, 0x0f, 0x0f, 0x8f, 0x9f, 0xff, 0xfd, 0xf8, 0xf0, 0xf8, 0xfc, 0x7c, 0x3c, 0x1c, 0x18, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x07, 0x0f, 0x1f, 0x1f, 0x3e, 0x7c, 
0x3e, 0x1f, 0x1f, 0x0f, 0x07, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00,
 0x30, 0xfc, 0xfc, 0xce, 0x86, 0x06, 0x07, 0x06, 0x86, 0x86, 0x84, 0x00, 0x00, 0x00,
 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0x66, 0x66, 0xf6, 0xfe, 0xbc,
 0x18, 0x00, 0x30, 0xfc, 0xfc, 0xce, 0x86, 0x06, 0x07, 0x06, 0x86, 0x86, 0x84, 0x00, 
0x00, 0x7e, 0xfe, 0xfe, 0x80, 0x00, 0x00, 0x80, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 
0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x06, 0x06, 0x06, 0xfe, 0xfe, 0xfe, 0x06, 0x06, 0x06, 
0x00, 0x80, 0x9e, 0x9e, 0x3e, 0x37, 0xb6, 0xf6, 0xe0, 0x40, 0x00, 0x00,0x00, 0x00, 
0x00, 0x00, 0x61, 0x61, 0x63, 0x63, 0xe3, 0xe3, 0xe1, 0x61, 0x61, 0x60, 0x00, 0x00,
 0x03, 0x03, 0x00, 0x00, 0x80, 0xc0, 0xc3, 0xe3, 0x63, 0x60, 0x60, 0xe0, 0xc1, 0xc3, 
0x03, 0x02, 0x00, 0x00, 0x01, 0x01, 0x03, 0xe3, 0xe3, 0xe3, 0xe1, 0x61, 0x60, 0xe0, 
0xc0, 0xc0, 0x00, 0x01, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x00, 0xc0, 0xe0, 0xe0, 
0xe3, 0xe3, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x23, 0x60, 0xe0, 0xe0, 
0xc0, 0x00, 0x81, 0xc1, 0xe3, 0x63, 0x23, 0x01, 0x01, 0x00, 0x00, 0x00,0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x07, 0x0f, 0x1f, 0x18, 0x18, 0x10, 0x18, 0x1c, 0x1f, 0x0f, 
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x18, 0x18, 0x1c, 
0x1f, 0x0f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1e, 0x1f, 0x0f, 0x0c, 
0x0d, 0x0f, 0x1f, 0x1e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
 0x1f, 0x1f, 0x1f, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
void setup()
{
glcd.Initialize_LCD();
}
void loop()
{
glcd.Invert(true);
glcd.allClear();
glcd.logoDisp(Logo);
delay(1000);
glcd.allClear();
glcd.Invert(false);
glcd.logoDisp(Logo);
delay(1000);
}


No comments: