Week 3 Homework

For homework this week (due on the blog 8pm Weds 9/27), please:

        • complete the first half of the Input/Output lesson of the Arduino Class:
        • compose a circuit and Arduino sketch of your own, based on examples you’ve completed so far, to solve one of the following:
          • two buttons control one LED (on and off)
          • pressing button changes fading animation speed
          • pressing button changes number of LEDs used in for loop iteration
          • three buttons control RGB LEDs to make a color mixer
        • post these exercises in the “Arduino Homework Exercises” category on the blog (one post with all exercises). Your original composition should print something useful to the serial monitor. Have fun with this one! Include your code in your post by using the html <pre> </pre> tags. Look at this post for an example.
int ledPin = 13; // choose the pin for the LED
int inputPin1 = 3; // button 1
int inputPin2 = 2; // button 2
 
void setup() {
  pinMode(ledPin, OUTPUT); // declare LED as output
  pinMode(inputPin1, INPUT_PULLUP); // make button 1 an input
  pinMode(inputPin2, INPUT_PULLUP); // make button 2 an input
}
 
void loop(){
  if (digitalRead(inputPin1) == LOW) {
    digitalWrite(ledPin, LOW); // turn LED OFF
  } else if (digitalRead(inputPin2) == LOW) {
    digitalWrite(ledPin, HIGH); // turn LED ON
  }
}
  • brainstorm and sketch three ideas for your next project: a plush nightlight! Make a separate post with your sketches and ideas in the “Works in Progress/Proposals” category. Your plush nightlight should:
    • have a story (who is it for? why does it light up like it does?)
    • be made from fabric
    • diffuse LED light in an interesting way (no more than 8-10 LEDs)
    • use of Arduino is completely optional, and if used board will most likely be located outside of toy

Author: Becky Stern

Making and sharing are my two biggest passions! I'm a Content Creator at Autodesk and part-time faculty at SVA. Check out all my Instructables and find me as @bekathwia on YouTube, Twitter, and Instagram.

2 thoughts on “Week 3 Homework”

Comments are closed.