Alerem menggunakan LDR Dan Bluetooth
Harus control dengan android bluetemint LDRValue = 0;
int LDRPort = 0;
int light_sensitivity = 500;
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
Serial.begin( 9600 );
}
void loop() {
// put your main code here, to run repeatedly:
LDRValue = analogRead(LDRPort);
Serial.println(LDRValue);
if (LDRValue < 500) {
digitalWrite(13, HIGH);
Serial.println("Ada maling");
}
else {
digitalWrite(13, LOW);
Serial.println("Aman");
}
//delay(1000);
}
Tidak ada komentar:
Posting Komentar