Making Almost Anything <-> MAS.863 <-> Fall 2011

Kristopher Dos Santos <-> Personal Robots Group


Week 11 <-> The Pot-Driven Simulator

<<<<<<< local

Needs more update, but this week I wanted to make a joint simulation using the Tkinter abilities of Python and the step-response function of the ATTiny45. By taking the values from a rotary potentiometer, the arm in the Python simulation would raise and lower accordingly.

=======

This week I wanted to make a joint simulation using the Tkinter abilities of Python and the ADC function of the ATTiny45. By taking the values from a rotary potentiometer, I wanted to manipulate a simplistic stick figure model of Adam Setapen's Dragonbot.

>>>>>>> other

PotSerial Board

<<<<<<< local

This board is made and I'm working on fixing the code; I'm having problems with the values that are being displayed

=======

I made a board with one 10K ohm potentiometer with a range of 347 degrees, feeding into the terminal of an ATTiny45. I fed the value into the ADC sequence, converted into an 8-bit value, then sent it over serial to a Python script that interpreted the value with respect to the resolution of the pot.

Python simulation

With the value, I did a bit of trig, and figured out the rest of the frame's position. Then, in Tkinter, I created a line object that had it's coordinates change based on the incoming angle value. Something I learned (from Brian Mayton) was that if you are indeed sending a 8-bit value over serial, the framin sequence actually clutters the communication. So in my code, the only thing sent with put_char is the angle value. Having the framing sequence there actually slowed the communication and generated a StackOverflow error.

Below is the video demonstrating the simulation. Enjoy!

>>>>>>> other

Back to home