703
edits
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
== Homework == | |||
build these examples on your breadboard (and use the code examples provided in the links if you want.) Then try to create arduino sketches which do something different than the example sketches there. | build these examples on your breadboard (and use the code examples provided in the links if you want.) Then try to create arduino sketches which do something different than the example sketches there. | ||
Line 7: | Line 9: | ||
=== Light dependent Resistor=== | === Light dependent Resistor=== | ||
http://fritzing.org/projects/photocell/ <br> | http://fritzing.org/projects/photocell/ <br> | ||
Use the same sketch as before, but use an LDR instead the potentiometer. | Use the same sketch as before, but use an LDR instead of the potentiometer. | ||
Use the serial monitor to see the values you receive, select different resistors and try again. <!--Also measure the resistance of the LDR and compare to the resistors you used.--> | |||
== If you have still time left == | |||
we didn't introduce everything in class for these examples and you don't have a Servo yet, so I don't expect you to solve them - however if you want, feel free to do so. | |||
===Buttons and switches=== | ===Buttons and switches=== | ||
Line 14: | Line 21: | ||
turn the LED on when pressing the button. Then turn the LED off when the button is pressed again. Note: The button bounces - use the delay function to debounce the button. | turn the LED on when pressing the button. Then turn the LED off when the button is pressed again. Note: The button bounces - use the delay function to debounce the button. | ||
=== | ===Controlling a Servo=== | ||
http://fritzing.org/projects/analog-input-to-servo/ | http://fritzing.org/projects/analog-input-to-servo/ | ||
The servos provided may cause your arduino board to crash. Use a capacitor in parallel to the servo's GND and 5V power | Note: The blue servos provided in class may cause your arduino board to crash. Use a capacitor in parallel to the servo's GND and its 5V power line. Mind the polarity of the capacitor! (your capacitor has a white "minus" mark, this should go to GND.) |
edits