Special thanks:
The guys at TinyClr.com was going to send me a free Panda, but when they saw that I already ordered one, they sent me a free FEZ Domino instead! WOW! Freakin’ awesome!
Thanks Gus, Robert, and Joe!
The first thing I noticed was that Domino has USB Host capability.
I believe, Domino is the least expensive microcontroller capable of USB Host.
And being a FEZ, it was Freaking’ EZ to use!
First, you subscribe to keyboard connect and disconnect events:
USBHostController.DeviceConnectedEvent += DeviceConnectedEvent;
USBHostController.DeviceDisconnectedEvent += DeviceDisconnectedEvent;
In DeviceConnectedEvent handler, register a CharDown event handler:
kbd = new USBH_Keyboard(device);
kbd.CharDown += new USBH_KeyboardEventHandler(kbd_CharDown);
That’s it! That’s Freakin EZ!!
Now, everytime you press a key on the keyboard, kbd_CharDown event handler would be called and you can do whatever you want with the keypress.
void kbd_CharDown(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
{
char typedChar = args.KeyAscii;
Here’s something I threw together yesterday. It should give you a taste of what’s possible when you have a full-size keyboard on a microcontroller. I imagine it won’t take much to create your own personal stand-alone twitter device.
Video:
[url]KeyRace - FEZ Domino USB Host Demo - YouTube
Code available at NETMFProjects:
(link removed)