Today, we got caught going on a game website. So we decided it was time to start working. We researched the program gobetwino. This program can do many things such as start a program on the computer, send an e-mail with an attached file, copy a file on the computer, and many more things. We are going to use it sending an e-mail to Mr. Dickie if it has caught a mouse in the greenhouse. We've also come up with the idea for it to take a picture and send it in the e-mail, but that is still under discussion. Because gobetwino only works with windows we had to move to the computer next to our right...inconvient. For that reason I have copied our program onto here so that we can get it off when we move computers. // by BARRAGAN <http://barraganstudio.com> #include <Servo.h> Servo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created int pos = 0; // variable to store the servo position int photocellPin = 0; // the cell and 10K pulldown are connected to a0 int photocellReading; void setup() { Serial.begin(9600); myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop() { photocellReading = analogRead(photocellPin); Serial.print("Analog reading = "); Serial.println(photocellReading); if (photocellReading<950) { for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } Serial.println("go"); } } |