PComp Labs Week 2

This is my blog post for working on week 2's labs.

Beforehand: Setting up the documentation process

Based on my experience doucmenting last week, I modified my set up significantly from last week. My camera is now mounted over my work. Here's what what looks like:

Nice, flat view of the floor.

Let's make the background white.

Here's what it looks like when I'm getting out supplies:

Before

After

Lab 1: Digital I/O

https://itp.nyu.edu/physcomp/videos/videos-digital-and-analog-input-and-output/#Digital_Input_and_Output

Here's the result!

DSC04885-ANIMATION

💡💡💡
For this lab, I didn't run into any issues building this, EXCEPT that initially I couldn't get the connection between the computer and the Arduino to work at all. After some time of trying all kinds of software fixes, I realized that the issue was that I was using a bad micro-USB cable. Turns out only some of the transfer data.

Lab 2: Analog I/O

https://itp.nyu.edu/physcomp/labs/labs-arduino-digital-and-analog/analog-in-with-an-arduino/

Also ran into no issues with the lab.

Add a potentiometer and LED

LED output

Speaker output
⏯ Video
Other variable resistors
Phototransistor

💡💡💡
This is the first exercise so far where the code isn't included. Here's the critical part of the code I wrote:

int in = analogRead(A0);

int out = 255 - map(in, 0, 10, 0, 255);
if (out < 0) {
  out = 0;
}

analogWrite(ledPin, out);

I had to experiment a bit to get a useful relationship between the input and output values. I chose to invert the relationship, turning the device into a night-light!

Activating by dimming the room

Activating with my hand

Force-sensing resistors

Pretty straightforward.

DSC04918-ANIMATION