This week I played around with python TKinter, and making my own GUI. Working towards my final project I decided to make a "Dashboard" application that get a speed value from an ATTINY board, and then represents it in the proper dashboard manner (ie needles in the right locations).A European e30s speedometer ranges from 0 to 240 kph, making an 8bit integer the perfect representation for speed. The application also tracks what "GEAR" the car should be in and calculates the tachometer position using accurate transmission gearing and differential ratio information.
In the future I hope to use this 'RPM' calculation to current limit the motor and give the RC car the proper power band feel.
Here are some pictures of the board and the GUI interface. The background is a gif of a e30 dashboard with the needles photoshoped out. The needles are then drawn using the canvas.polygon function provided in the TKinter library.
The needles are defined by 4 vectors (pointing from the center of rotation to the 4 points). Rotation is accomplished using pythons handy complex notation features by simply multiplying by e^(theta*i), where theta is the desired angle of rotation