Академический Документы
Профессиональный Документы
Культура Документы
EGN1007
Learning Goals
Learning Goals: The student will be able to:
1. Build a complete circuit using the Arduino microprocessor 2. Identify important electrical components in a circuit and explain their use 3. Identify and apply specific elements in C code used to run a program in conjunction with how a circuit is built
Lets Begin
1. Place FSR on G5 & G6 2. Run a red wire from the 5V on the Arduino to H5. This will supply the FSR with 5V. 3. Run a wire from Analog 2 to H6. 4. Place a 10KW resistor(Br-BL-O) in I6 and I12. 5. Place the LED on G15 and G16 with the longer lead(+) of the LED in G15. 6. Place a 560W resistor on H16 and H22. Notice that both the resistor and LED share row 16 7. Run a red wire from Digital 9 port on Arduino to H15. 8. Run a black wire from H22 to the ground(GND). 9. Run a black wire from H12 to I22.
These will tell us which ports our LED and FSR are in.
We have a new piece of code here: Serial.begin ( ) Sets the data rate in bits per second (baud) for serial data transmission. So basically we are going to transfer 9600 bits per second to the computer. Old modems attached to our phone lines used to work at this speed. This was considered FAST back in the day, until 14400 finally came out.
When println is used after the Serial command it takes the reading from the FSR and displays it in a window(debugger) for inspection. Compile, download, and test. Does the LED light up.
Your turn!
Using what you have learned in this lesson AND the last lesson, write a short program that is BETTER than the one we wrote. Hint: Use the debugger to get the values you need and use information previously learned. The response from the LED should be a bit smoother. Write your code on the lesson worksheet and explain your code.
Challenge
Can you write a program that lights more than one LED using the FSR so that they light in a sequence or other pattern?
Write your code on the lesson worksheet and explain your code.