Download the Arduino IDE: https://www.arduino.cc/en/software
Download the Starter Kit PDF from Elegoo’s website: https://www.elegoo.com/blogs/arduino-projects/elegoo-mega-2560-basic-starter-kit-tutorial
NOTE: if you did NOT purchase the MEGA kit, you may need to use a different version or otherwise change pin numbers
Lessons 0 and 1 are not required, but feel free to review if you wish.
Lesson 2 shows you how to program your Arduino. Follow that lesson and make the onboard LED blink.
Deliverable A: Make the built-in LED blink in a pattern 100ms on, 100ms off, 100ms on, 700ms off. You should see two rapid blinks, then a pause.
Lesson 3 shows you how to connect an external LED from your kit to your Arduino. Follow the lesson.
At the end of the lesson, your LED will be plugged into +5V power and ground. Remove the connection to power and instead connect to one of the digital pins.
HINT: To future proof a bit, avoid pins labeled RX, TX, SDA, SCL, or other things that look special. These are used for other, more advanced functions
Create a new sketch like your blink sketch from Deliverable A, but change the pin number and blink pattern.
Deliverable B: Use your LED to count from 1 to 5. Write code so that the LED blinks 100ms on, 200ms off for the count that it is on. For example, count 3 would look like on 100ms, off 200ms, on 100ms, off 200ms, on 100ms. Pause 700ms before moving to the next number. Use a for or while loop to control your LEDs, do NOT hardcode 1-5.
Lesson 4 shows you how to control a tricolor LED. Follow that lesson.
Deliverable C: Create a program that smoothly transitions the LED through a color pattern of your choice. At some point, all three colors need to be used. The pattern should be nontrivial (e.g. do more than making one color brighter).
Challenge: smoothly transition through the whole rainbow
Submission instructions: Put all of your code in one zipfile and submit to Blackboard. LABEL your code files/folders by deliverable and homework number (e.g. 5A).
Rubric
Demo:
Deliverable A: 10 points
3 points: LED is powered on
3 points: LED blinks in some pattern
4 points: LED blinks in specified pattern
Deliverable B: 10 points
3 points: external LED connected and controlled in some way