Stap 3: CODE
Hier is de Code die u uploaden naar je Arduino moet:-
int rcvpin = A0;
int buzzpin = 9;
VOID Setup
{
pinMode(rcvpin,INPUT);
pinMode(buzzpin,OUTPUT);
Buzz(200);
Buzz(200);
Buzz(200);
delay(2000);
Serial.begin(9600);
}
void loop
{
int ldrval=analogRead(rcvpin);
Serial.println(ldrval);
Als (ldrval > = 900)
{
Buzz(50);
}
}
VOID buzz (unsigned char keer)
{
analogWrite(buzzpin,170);
delay(time);
analogWrite(buzzpin,0);
delay(time);
}