Arduino Storyboard

In class

This week we started working with Arduinos. I already have a bit of experience with them, so I had no trouble setting up the led circuits and making them blink SOS:


However, the capacitive touch sensor gave me a bit of trouble. I got it to work for awhile, and then it would randomly stop and only give off 0’s. Every once in awhile it would go back to working for seemingly no reason. I did notice the difference between when I touched the resistor and when I touched the tin foil, so I worked on the threshold code even though I couldn’t test it very well.



Since I’m pretty familiar with Arduino, I wanted to come up with something challenging. I have a game controller and a strand of Neopixels, so I started thinking about things I could do with that. I came up with the following image:

Basically, sometimes I’m in my room just hanging out, and sometimes I’m there to study. The same goes for my roommate. I thought it would be cool for the lights to indicate to the other which one it is. For example, if one of us needs to focus the lights could be red and if not they could be blue. The color could be altered based on how long you hold the joystick.



It turns out, to actually connect the joystick to the Arduino, I needed to use a second program called Processing. Luckily, the language was basically the same as Arduino, and I was able to figure it out with the help of a tutorial. I really enjoyed working on this part, so I actually added some other modes using the buttons on the controller. After ‘A’ is pressed, the joystick controls the light color as originally planned. After pressing ‘B’, the joystick can be held back and released to fling a single pixel across the strip. Pressing ‘X’ lets the joystick control with pixel will light up so it looks like its moving:


Writing the logic for the joystick wasn’t very complicated, it just took some planning. Most notably, sometimes it was easier to keep track of variable in the Processing code and then send them to the lights, and sometimes it was easier to send raw data to the Arduino code and deal with it there. In the end, I had this code:

Even though there was a lot to think about, I had a lot of fun both making it and playing with the finished prototype.