percobaan 1s

Download Percobaan 1s

If you can't read please download the document

Upload: syafei-yusri

Post on 24-Sep-2015

221 views

Category:

Documents


2 download

DESCRIPTION

s

TRANSCRIPT

Percobaan 1 Menampilkan pembacaan input LM35 pada seven segment dan LCD

#include #define LM35 A8 // RS E D4 D5 D6 D7 LiquidCrystal lcd(22 ,23 ,24 ,25 ,26 ,27); // a b c d e f g byte _7segmen[10][7]={{1 ,1 ,1 ,1 ,1 ,1 ,0}, // 0 {0 ,1 ,1 ,0 ,0 ,0 ,0}, // 1 {1 ,1 ,0 ,1 ,1 ,0 ,1}, // 2 {1 ,1 ,1 ,1 ,0 ,0 ,1}, // 3 {0, 1 ,1 ,0 ,0, 1 ,1}, // 4 {1, 0 ,1 ,1 ,0 ,1 ,1}, // 5 {1, 0 ,1 ,1 ,1 ,1 ,1}, // 6 {1 ,1 ,1 ,0 ,0 ,0 ,0}, // 7 {1 ,1 ,1 ,1 ,1 ,1 ,1}, // 8 {1 ,1 ,1 ,1 ,0 ,1 ,1}}; // 9 // a b c d e f g int pin7segmen[]={7 ,8 ,9 ,10 ,11 ,12 ,13}; // Puluhan Satuan int pinKontrol[]={ 6, 5}; int satuan, puluhan; int nilaiSuhu; void kode7segmen() { satuan=nilaiSuhu%10; puluhan=nilaiSuhu/10; puluhan=puluhan%10; lcd.clear(); lcd.setCursor(0,0); lcd.print("LM35 Sensor Suhu"); lcd.setCursor(7,1); lcd.print(nilaiSuhu); for (int i=0; i