For week 2’s labs, I tested out the digital inputs/outputs of the arduino nano Iot33. The pins are quite clearly labeled in the labs so I had no trouble pinning down the different wires. Prior to this class, I had tried building out a midi glove from arduino, but had failed due to a lack of foundational knowledge, so I’m glad that this lab allows me to revisit some concept that I had misunderstood before.

LAB 1: Digital inputs & outputs with pushbutton

After setting up the arduino to the breadboard, I connected the push button to a 10k resistor serving as the pulldown resistor, then connected it to the analog pins. I connected the 2 LED lights on the digital pins(in series, using 220 ohm resistors), and set them as the output of the analog pins. I used an if -else statement in the main loop of the code, and was able to turn the pushbutton into a switch, switching between 2 LED lights.

LAB2: ANALOG w Potentiometer

For this lab, I used both the potentiometer and the force sensors as inputs. I was able to use the potentiometer to dim and light up the LED, but I encountered some issues with the force sensor.

Question: Mapping sensor values sometimes does not work: I first serial printed the force sensor value’s original output, and it ranged from 0-1000, when I tried mapping out the numbers to the range of 0-255, the serial print is still outputting number range of 0-1000?

Screen Shot 2022-09-25 at 5.18.54 PM.png

For some reason, the green LED refused to light up upon triggering the force sensor. After several rounds of debugging, I realized I misplaced the legs of the LED in the opposite direction. After fixing it the green light was able to function.

LAB3: SENSOR CHANGE DETECTION