Changes

Students/Scott Chiu

800 bytes added, 10:09, 19 March 2010
Final Project: eMailbox
====Proposed Arduino Code====
The first part involves the coding for Arduino. This was to move the servo and motor in order to raise the flag, as well as activate the notification lights within the mailbox, in response to receiving an e-mail.
<source lang="php">#include <MsTimer2.h>#include <Servo.h>Servo myservo;int val;int pos;void flash() {static boolean output = HIGH;digitalWrite(9, output);output = !output;}void setup(){Serial.begin(9600);Serial.flush();myservo.attach(10);}void loop(){if (Serial.available()){val = Serial.read();Serial.println(val, BYTE);if (val == 110) // n = 110 in dec{pinMode(9,0);pos = 0;}else if (val == 109) //109 = m in dec{pinMode(9, OUTPUT); MsTimer2::set(150, flash); // 150ms periodoMsTimer2::start();pos =140;} }myservo.write(pos); // tell servo to go to position in variable 'pos'delay(15);}</source> ====Actual Arduino Code: Simple Servo Motor & Light Activation====
This code only provides movement of the servo as well as the blinking of the notification lights.
====Proposed Python Code====
The Python script was to allow communication between the internet server (specified as Gmail) and the Arduino by opening the serial port that contained the Arduino. This was copied from Credits to [http://arduino.myblog.it Angelo Coppola].
<source lang="python">
56
edits