-
assignment
- measure something and display the results.
-
setting up
-
I've been working from the computer in fab lab and decided that this week I'd finally try setting up my own computer to work with the microcontroller programming tools. My research group has been working on a 3D graphics platform, called E15 that has an embedded Python interpreter, so I thought it'd be fun to use that instead of Tkinter to display my measurements. Unfortunately, the Serial to USB converter I had didn't play nicely with the sensor board, so after all my trouble I still had to use Tkinter on the computer in fab lab.
-
-
Tkinter constraints
-
My idea for this project was to take an image of a character, and illuminate the character based on input from a light sensor. I wanted to do this by drawing a transparent black rectangle over the image, and varying the transparency based on the value from the light sensor. However, a quick Google search led me to believe this was impossible (see results below):
I got around this problem by changing the background color of the window and overlaying an image with a transparent background. I had to modify the original image to take out all the colors except for the black outline of the character. Many thanks to Simon, who helped me figure out how to make this happen in GIMP.
-
-
results
-
I used the sample design and assembly code to produce the light sensor board. With a few modifications to the hello.light.45.py sample code I was able to get the client program to draw the image and change the background color: reader-light.py. I don't have a laptop to demo on in class right now, so I'll substitute a live demo with this video of Simon controlling the character's reading light:
-
-
serial troubleshooting
-
As I mentioned, I had some difficulties trying to get my Mac set up with a Serial to USB adapter. I tried two different Keyspan adapters that I found in my lab, but both produced funny values when I ran the sample code (hello.light.45.py) to read values from the basic light sensor circuit.
Initially my computer wouldn't read any values from the sensor. The cable I had constructed for serial communication from a few weeks ago didn't have enough connectivity. Dawn said she had the same problem, and fixed it by using a trick Simon had learned from a mystery man who happened to be passing through fab lab! Thanks, mystery man.
The basic idea is to pad the AMP end of the cable with something squishy, so that when it's squeezed in the vice, the cover of the AMP pushes into the squishy material and it's easier for the teeth on the bottom part to cut through the wire. I think. Anyway, it works! For documentation purposes, here's what it looks like (and some meta-documentation from Simon):
I'm still working on getting the Serial to USB adapter to work with my Mac. More on that next week, I hope. I also started working on building the dasa board, but testing it will have to wait until I get two working Serial to USB adapters.
-