int suhu = A0;Semoga bermanfaat
int led = 13;
void setup() {
// put your setup code here, to run once:
pinMode(suhu,INPUT);
pinMode(led,OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int nilaisuhu = analogRead(suhu);
Serial.println(nilaisuhu);
delay(1000);
if(nilaisuhu <= 400){
digitalWrite(led, LOW);
}
else{
digitalWrite(led,HIGH);
}
}
Coding Sensor Suhu Menggunakan Arduino Uno
24Jan2017
Posting Komentar