/*Written by Evan Funk*/ int buzzerPin = 7;//The pin your buzzer is set to int normalLight = 100; //This is your normal intake of light, you might need to change it arround a little int vary = 5;//How lenient you want your security system to be on light intake changes void setup() { pinMode(buzzerPin, OUTPUT);//Set buzzer Pin to output Serial.begin(9600);//Begin the Serial port } void loop() { //Read the photo resistor values int pinOne = analogRead(A0); int pinTwo = analogRead(A1); if (pinOne > normalLight - vary && pinOne < normalLight + vary){//Check if everything is normal //All good }else{ analogWrite(buzzerPin, 100);//Sound the alarm } //Repeat Code for each photo resistor if (pinTwo > normalLight - vary && pinTwo < normalLight + vary){ }else{ analogWrite(buzzerPin, 100); } //This should help with setting the vary and normalLight values Serial.println(pinOne + ", " + pinTwo); }