Week 10: Output Devices

This week I experienced the magic of what Neil was describing when software meets hardware. It is magic.

I used Neil's hello.RBG.45 LED schematic and drilled it on the modela. I also attempted to cut the Charlieplexing LED array, but the bad initial drilling on top of the daunting soldering job was enough to deter me.

As usual, the modela drilling is an art between getting the drill to touch the copper right along bed

The first plug in was a negatorial. So I began troubleshooting the board for shorts

For my project I wanted to use the ADA fruit neopixels, so here was the process:


ADA Fruit White 30 LED Neopixels<

HC-SR04 Sonar Sensors.

At first I started with using the PIR infrared sonar. While it worked, it was not a fitting input device for my purposes because trash does not emit heat and one had to stand at a further distance in order for the sensor to pick up any movement

Working with adafruit neopixels was wonderful. The LEDs are beautiful and the abundance of coding examples online to treat the lights were bountiful. It gave me great dexterity with capturing the behavior of the fish using light. The only things to remember: One cannot plug it in from both sides; there is distinctive an input and outputs side. 3 pins to plug in: 1 for the LED pin, 1 for ground, 1, for VCC, and lo and behold, Magic!

Turned out that the 5 voltage regulator was not soldered correctly. Then uploaing the LED arduino script, and also readjusting the ATTiny45 pins to arduinos, we were able to get the LEDs to work. Here was the final script:

/* Adafruit Arduino - Lesson 3. RGB LED */ int redPin = 1; int greenPin = 2; int bluePin = 0; //uncomment this line if using a Common Anode LED //#define COMMON_ANODE void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { setColor(255, 0, 0); // red delay(1000); setColor(0, 255, 0); // green delay(1000); setColor(0, 0, 255); // blue delay(1000); setColor(255, 255, 0); // yellow delay(1000); setColor(80, 0, 80); // purple delay(1000); setColor(0, 255, 255); // aqua delay(1000); } void setColor(int red, int green, int blue) { #ifdef COMMON_ANODE red = 255 - red; green = 255 - green; blue = 255 - blue; #endif analogWrite(redPin, red); analogWrite(greenPin, green); analogWrite(bluePin, blue); }