#include const int ldrPin1 = A0; // LDR sensor 1 connected to analog pin A0 const int ldrPin2 = A1; // LDR sensor 2 connected to analog pin A1 const int threshold = 500; // Threshold value for detecting "shit" const int servoPin = 9; // Servo motor signal pin connected to digital pin 9 Servo myServo; void setup() { pinMode(ldrPin1, INPUT); pinMode(ldrPin2, INPUT); myServo.attach(servoPin); } void loop() { int ldrValue1 = analogRead(ldrPin1); int ldrValue2 = analogRead(ldrPin2); if (ldrValue1 < threshold) { // LDR sensor 1 detects "shit", turn the servo left myServo.write(0); // Set servo angle to leftmost position (0 degrees) delay(1000); // Delay for 1 second (adjust as needed) myServo.write(90); // Set servo angle back to the center position (90 degrees) } if (ldrValue2 < threshold) { // LDR sensor 2 detects "shit", turn the servo right myServo.write(180); // Set servo angle to rightmost position (180 degrees) delay(1000); // Delay for 1 second (adjust as needed) myServo.write(90); // Set servo angle back to the center position (90 degrees) } }