Sunday, April 25, 2010

Teensy 2!


This little thing is damn cool!

I have now been diving into micro-controllers, registers, timers, interrupts... all that to make the multicolored LED dim! Turning the LED on or off is easy. It's hell of a lot more complicated to make it work between on and off. To turn it on or off, I just have to activate some pins. To dim, timers and interrupts are used to create a PWM (Pulse-Width Modulation)!

I'm waiting for the sensor to arrive, but the wait is good, because I can use the time to learn more about this electronic stuff. I just love how it all works with the Teensy. Hook it up with USB to power it, and be able to flash it. You flash with a simple program by just pushing the button on the Teensy! You do the code in C (or assembler if you want). The compiler creates a .hex file, which is used to be flashed onto the device. It's all quite simple, thankfully! This means you can put more effort in how to actually use it, which takes time if you haven't been doing much of this before. But, with my background, and ease of learning, I will figure it out eventually. Also, there is Internet you can use for resources...

I also love how the thing can pretend to be any kind of USB device! It's all up to what you program the microprocessor to tell what it is when the handshake is taking place between the HOST (your computer) and this device. This will solve the driver issues and mouse issues explained before.

Tuesday, April 13, 2010

Digital to Analog

Currently, the usage of the treadmill sends keystrokes. This means digital, on or off, 0 or 1. Now I'm trying to figure out how I can create an even natural experience by mapping the analog mouse events to the game as most games supports this. Just by connecting a XBOX 360 controller, you can play games with the analog sticks, and thus change speed of movement continuously. Now I want to do that with my treadmill.

By the way, current game of interest is Just Cause 2!