Group 5 – Baptism Chair

Melissa Guenet and Romee de la Bigne
Process:
Final look:

- – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – -
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int lightpin = A5; // analog pin used to connect the light sensor
int val; // variable to read the value from the analog pin
void setup()
{
Serial.begin(9600);
myservo.attach(9); // attaches the servo on pin 9 to the servo object
myservo.write(50);
delay(1000);
}
void loop()
{
val = analogRead(lightpin); // reads the value of the light sensor (value between 0 and 023)
Serial.println (val);
if (val > 400){
myservo.write(160); // sets the servo position according to the scaled value delay(1000);
myservo.write(50);
delay(500); // waits for the servo to get there
} }




