Kendali 3 Motor berdasar Nilai Suhu dengan Penampil LED Bargraph Arduino Uno
1. Judul : Kendali 3 Motor berdasar Nilai Suhu dengan Penampil LED Bargraph 2. Gambar Rangkaian 3. Listing Program char pin[] = {13,12,11,10,9,8,7,6,5,4}; byte pola[] = {0x02,0x9e,0x24,0x0c,0x98,0x48,0x40,0x1e,0x00,0x08}; long suhu; char level; byte nyala; const int motor1= 0,motor2= 1,motor3= 2; void setup() { for(char i=0;i<10;i++) pinMode(pin [i], OUTPUT); pinMode(motor1,OUTPUT); pinMode(motor2,OUTPUT); pinMode(motor3,OUTPUT); pinMode(3,OUTPUT); } void loop() { delay(50); suhu = analogRead(0); suhu=suhu*500/1023; level = suhu/10; if(level>10) level=10; LED(level); if(suhu >=30 && suhu <=50){ digitalWrite(motor1,HIGH); digitalWrite(motor2,LOW); digitalWrite(motor3,LOW); } else if(suhu >50 && suhu <=70){ digitalWrite(motor1,HIGH); digitalWrite(motor2,HIGH); digitalWrite(motor3,LOW); } else if(suhu >70 && suhu <=100){ digitalWrite(motor1,HIGH); digitalWrite(motor2,HIG