Do-it-yourself USB mouse from accelerometer and USBAsp programmer
Actually it turned out I have almost such a mouse, as in the photo. (well, almost at all =)) I took my old USBAsp programmer for AVR microcontrollers and accelerometer ADXL322JCP as a basis . This accelerometer is selected for the following reasons: - measures acceleration up to 2g - was available in the store - was one of the cheapest (or rather the cheapest) Due to the small range of measured accelerations, this accelerometer allows determining the position of the chip. Well, respectively, it turns out something like measuring the angle of inclination. At what degree the mouse bent, with such speed the cursor and rush off. (at least for me) :) He can simply deviate on a slope. Like the mouse in the picture. To begin with, I used unused feet in the programmer with an ADC, and connected a variable resistor to the test for them. I played a little, even made me work like a USB mouse thanks to this article and the AVR-USB library. There actually is a ready-made demo version of the USB mouse device, which when connected, causes the cursor to move in a circle. I, without hesitation, set up the ADC, set the rarest interruption, changed a few lines of code in the finished example. I asked. And everything earned from the first. =) It turned out fun, you turn the resistor, and the mouse cursor goes here and there. Well, I think the case remains for the most difficult, soldered to the body LFCSP (4 x 4 x 1.45 mm !!! and as many as 16 conclusions !!! of which, in essence, current 5 is needed). After an hour of soldering and reasoning how best to arrange, finally soldered, attached, flashed and turned on. And lo and behold, everything began to work the first time, first one channel, then connected the second channel. Everything is working. You bend down one way, the cursor ran to the left, the other, the cursor ran back, it also runs up / down, fun. =)