You are on page 1of 9

Automation: Material Segregation

(metal and non-metal)

(project update)
Ganth chart
basic code
#include <Servo.h>
Servo myServo;

byte servoPin = 10;


byte buttonPin = 8;
byte servoPos;

void setup()
{
myServo.attach(servoPin);
pinMode(buttonPin, INPUT_PULLUP);
}
void loop()
{
if (digitalRead(buttonPin) == HIGH)
{
myServo.write(90);

}
else
{
myServo.write(45);
delay(3000);
}

}
picture of pre - build project

You might also like