Yes, I can probably make a working mouse/keyboard/joystick/gamepad using any weird sensor I can find within an hour.
Warning, the circuit you see in macetech.com might not work on all computers. It'll work on SOME computers, not ALL. I made the same mistake and discovered that you must have 3.6V zener diodes on the D- and D+ line if you want to use 5V as the power source.
I already need a resistor assortment pack and many other bits (like caps for one) from there, looks like I should get a couple bucks worth of Zener diodes.
that little application its based on vusb and as frank26080115 said on most computers youll need to use diodes on the D-,D+ to limit the voltage on that lines you can read more here
Thanks for the links. I really do like the minimalist approach. I see ATTiny85 for under $2 at Mouser.
While getting ready to buy (soon) I've run across the not-completely-Arduino Teensy and Teensy++. They promise to do HID almost painlessly, with examples. Well, -maybe- later.
yeah the dip package its under 2$ (smd its a bit over $2) but be sure to order the attiny85-20 since you need to use the internal oscillator at 16.5mhz
I've got some 20 pin sockets they'll fit in that if I wire up properly will sub for circuit boards. Bit of hot glue to pot and have an instant base/insulation. I do need to make or get a USB plug...
After proving I can do a cheap HID, I have parts to build flight sim rudder pedals as you can't get decent ones for less than real money.
It is all that it takes from a hardware point of view. The software part is not that easy. I once wanted to implement a "caps lock be gone". The ideas was to register as a hid keyboard. Whenever said "keyboard" received the command to light up the caps lock LED it would send a caps lock keypress. This never really worked. The interesting part is that (a) this works for num lock without a flaw (b) according to wireshark the issue that the "light up the caps lock light" did not always got sent by the computer - but only for the fake keyboard.
Frank, IIRC from your business card demo the user is instructed to hit caps Lock 3 times to start your contact info coming it to his notepad window....
GoForSmoke:
Frank, IIRC from your business card demo the user is instructed to hit caps Lock 3 times to start your contact info coming it to his notepad window....
i can confirm that i burned the source on a custom atmega8 board (made some changes to the source) and when i tried it on ubuntu it was not working - but on windows worked without a problem
that behaviour differs between Windows, Linux, and Mac, and yes it does depend on which LED too
According to the HID standard the behaviour should NOT depend on the OS. Anyway the behaviour was correct for "real" keyboards, only with my "keyboard" I saw hickups. I read the standard several times and monitored the bus. Till today I have not even the faintest clue why this failed. The only hint / difference was that all real keyboards registered as USB 2.0 devices whereas my fake keyboard registered as a USB 1.1 device.
Could you read the regular keyboard? Could you watch for the CapsLock to be pressed instead of watching for the light?
Yes I could but it would defeat the whole idea. The idea was a dongle that would just be added without any modification of the keyboard or the computer's configuration.
I could also rip the chips out of a standard keyboard but the idea was to use just a tiny85.
GoForSmoke:
Frank, IIRC from your business card demo the user is instructed to hit caps Lock 3 times to start your contact info coming it to his notepad window....
Yea that works for Windows only apparently
If you change the card to use some of the copper for a capacitive sensor then you could change the instructions to touch the plugged in card on some spot to initiate? Hell, you could have different touch spots trigger different actions, at least within the limits of the chip(s) on the card. How much memory can you cram on -cheaply- that the Tiny can use?
It is important to remember that the HID driver handles those devices (or actually those interfaces on each device) that claim to comply with the Human Interface Device (HID) specification. However the HID specification doesn't say anything about what the HID driver should do with information received from a HID device, or where the information that is sent to a device comes from, since this is obviously dependent on what the device is supposed to be doing, and what the operating system is. Linux (at the operating system kernel level) supports four interfaces to a HID device - keyboard, mouse, joystick and a generic interface, known as the event interface. These are implemented by the Input device level.
Plenty room for wiggle:
You may not need any operating system support at all to use a USB keyboard if you have a PC architecture. There are several BIOS available where the BIOS can provide USB support from a keyboard plugged into the root hub on the motherboard. This may or may not work through other hubs and does not normally work with add-in boards, so you might want to add in support anyway. You definately want to add keyboard support if you add any operating system support, as the Linux USB support will disable the BIOS support. You also need to use Linux USB keyboard support if you want to use any of the "multimedia" types keys that are provided with some USB keybords.
Sorry GoForSmoe, but your hints are completely off the mark. As I said I was digging really deep into the subject. There is no "keyboard release caps lock command". Only a toggle caps lock command. Also the standard states that the host is responsible for keeping proper caps lock state. Hence there is no means for a keyboard to detect the state but the request from the host to enable the caps lock light. If the host does not send it (which it did not in my case) then you are out of luck. I am absolutely sure that the host was causing the issue because the command was not visible on the bus. However I still have no idea why the host behaviour was different for my device only.
Well you plug the thing into the PC you are using. Can you tell it the CapsLock state from the PC keyboard or notepad as part of starting the plug proper?