90 likes | 230 Views
ESC100 Design Studio. Session 3: Arduino Circuitry and Control Prof Anderson, Section 2. preliminaries. Collect Memo Labs Return HW 2(solutions on line) Q About HW 3? Lecture Material? HW4 online today – review and see me tomorrow if you have questions! Use of Office Hours.
E N D
ESC100 Design Studio Session 3: Arduino Circuitry and Control Prof Anderson, Section 2
preliminaries Collect Memo Labs Return HW 2(solutions on line) Q About HW 3? Lecture Material? HW4 online today – review and see me tomorrow if you have questions! Use of Office Hours
amazing engineering www.nytimes.com Learning to FLY
Today’s Exercise www.sparkfun.com More Arduino practice. writingk-8.wikispaces.com
Procedure Part 1: Stoplight Design • Review the sketch for Circuit 3 (attached) with your lab partner. • Review Circuit 3 in the SIK Guide. Try to build the circuit using the circuit diagram on p 28 as your only guide. • Add a push button to your circuit. • Write your own sketch so that the LED acts like a traffic light and the button acts like a sensor on a cross street and follows the following sequence: • LED is normally green • When button is pushed there is a 2 sec delay and then the LED turns yellow • LED remains yellow for 4 sec and then LED turns red. • LED remains red for 8 sec and then the LED returns to normal (Green) • Note: Use Circuit 03 and the sensor control code from last week as a guide. • Demonstrate functionality to your lab instructor and save your sketch under a new name.
Procedure Part 2: Motor Control • Review the sketch for Circuit 12 (attached) with your lab partner. • Review Circuit 12 in the SIK Guide. Try to build the circuit using the circuit diagram on p 64 as your only guide. Connect to pin 6 instead of pin 9. • Modify sketch for circuit 12 so you use pin 6 instead of pin 9. • Run the modified code and verify that it works • Add a potentiometer • Write your own sketch to use the potentiometer to control the speed of the motor. • Demonstrate functionality to your lab instructor and save your sketch under a new name. • NOTE: DON’T RUSH – TAKE THE TIME TO LEARN THIS SO YOU CAN APPLY IT TO YOUR PROJECT!
Review Push Buttons In Setup: pinMode(buttonPin,INPUT_PULLUP); In Loop :buttonVal=digitalRead(buttonPin); // (1=not pushed 0=pushed)) if (buttonVal==LOW){ //If the button has been pushed //do something here }
Reporting Style Individual Memo Lab Report – Due at start of lab next week. Review guidelines, see me to discuss
Get started! Work in groups of two: • Team 1a: Barhoush & Bauer-Moshi • Team 2a: Costa & Fontaine • Team 3a: Forti & Gutierrez • Team 4a: Kaljulaid & Leone • Team 5a: Manus & Matthews • Team 1b: McDonnell & Michel • Team 2b: Noonan & Rose • Team 3b: Schwartz & Ullrich • Team 4b: Wojtowicz & Wood