Wednesday December 4, 20134:03 AM Posted byKristin

Interface and Application Programming

This week's assignment was to write an application that interfaces with an input or output device. When I began this project I was most interested in exploring Processing and Python. After going through many Processing examples I decided to switch over to Python because of how suited one of the built-in Python libraries, Tkinter, was for building an input interface for my device.

My goal this week: make a GUI that allows a user to turn on any combination of LEDs in an LED array. I approached this task by looking at previous Tkinter examples from around the web. I really liked a tutorial I found for turning on LEDs using a grid of Tkinter buttons (load the Instructable one step at a time rather than viewing all steps at once if you want to see the download links). I initially tried working from the existing code, but ended up reworking the code entirely for reasons of both positioning of buttons and readability.

GUI Code ( Lines that have anything to do with serial have been commented out because I was not able to get that aspect to work)

I had a lot of trouble getting my serial code to work. I got to the point where I could get the board to talk to the serial port, but I couldn't get the serial port to talk to the board (I literally just realized what my mistake was. Pro tip: if you are trying to communicate with the board from the serial port, make sure that you wire the RX line. I only wired the TX line, which means that the microcontroller could only transmit information, not receive it). Other random tips:

-You can debug serial code by running just the TX and RX to an FTDI cable rather than wiring an entire FTDI header

-This being said, reinforcement would probably be good (even if it were to take the form of Scotch tape) because the TX pin of my microcontroller pulled off while I was trying to debug

-Individual pin connectors make excellent tips for plugging wires in (thanks Anya!). Especially when working with stranded wire.

-It is much easier to pinpoint problems in your code if you break it down into smaller, more manageable chunks and get those working before putting it all together. I did this to make sure I was able to communicate with the serial monitor before trying to control the board with said serial monitor.

 

Things to work on in the future:

-Get serial communication code working from computer serial port

-Get serial communication code working from master microcontroller

-Interface multiple boards

 

Final Project Updates

Given the remaining amount of time left in the semester (less than two weeks) I am rethinking my final project. I've narrowed my ideas down into three distinct projects and now just need to pick one and work through it.

Idea #1: Iron Man Arc Reactor

This idea is interesting because it has the potential to combine so many fabrication techniques but the idea has been done a lot before. This is both a good and bad thing: there are plenty of places to look when things aren't going correctly, but, at the same time, the project seems a bit more canned. I have worked a bit on this project already for the output devices week and have had moderate success with designing a board and the face for silhouetting. The main issue that I need to work through is how to diffuse the light of the LEDs. I'm currently looking into polymorph plastic at the suggestion of the internet.

 

Idea #2: Umbrella Raft

Umbrellas and rafts both exist, but I've never seen the two combined in quite the way that I'm picturing. I've been inspired recently by surrealist paintings involving umbrellas. The umbrella raft took shape in my head over the coarse of a few days and I haven't been able to shake it.

The standard Final Project Questions as they relate to an Umbrella raft:

Q: What does it do?

A: I'm picturing a sort of illusion: someone stands in an upside-down umbrella and floats down the river, seemingly only supported by an umbrella. I'm sure there would be some double-takes. The illusion of an umbrella free-floating on the surface of the water would be accomplished by making underwater outriggers out of buoyant clear plastic. Outriggers will make the umbrella much more stable while transparency will make the structure virtually invisible when submerged.

Q: Who's done what beforehand?

A: Rafts come in many different forms. The closest I've seen is a raft with umbrella sails.

Q: What materials will you use?

A: I will use an umbrella and transparent plastic to make the body of the raft. Many of the transparent plastics I've been looking at aren't buoyant enough to suit my purposes, so I will likely need to create pockets of air... possibly with inflatables.

Q: What processes will be used?

A: 2D fabrication for the submerged raft base (likely a combination of the Shop Bot and Laser Cutter), 3D design for the inflatable air pockets (and, time permitting, a paddle). Electronics and water generally aren't the best of friends, so circuitry may not make an appearance.

 

Idea #3: Tetris Pants

Have you ever been bored in class and had the urge to play Tetris, were too lazy to take out your phone? Tetris pants are the obvious solution to this problem. Just hit the power switch and kick up your feet to play. I'm picturing a pair of jeans with a 5x20 LED grid on each leg. On the right thigh are four button inputs to translate and rotate the blocks. A master microcontroller does all of the processing for the game graphics and sends instructions over an asynchronous bus. Slave microcontrollers then PWM the LEDs of occupied squares. This would require networking many ATTiny LED arrays to build a large LED array that has individually controllable LEDs while still maintaining brightness by splitting the PWM over multiple boards. The closest thing that I've found to this is the Tetris Tie:

I've been thinking about four main fabrication methods for this idea:

-conductive thread

-vinyl cutter + copper tape

-conductive paints

-combining conductive thread and vinyl to reinforce the vinyl.

Flexibility (in conjunction with durability) and comfort are two main concerns.