Teensy Duino - Auto Login
Teensy 3.1 auto login sketch
I recently got a Teensy 3.1 and have been looking for little projects to do.
This is a quick one that I wrote that, when plugged in, automatically logs me into my computer.
It uses the basic keyboard emulation to send keys to the computer, typing in my password.
It uses 3 char arrays, with the letters/numbers properly offset so that its easy to send the proper int to the usb_keyboard_press function
char keysLower[31] = "0000abcdefghijklmnopqrstuvwxyz";
char keysUpper[31] = "0000ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char nums[68] = "pppppppppppppppppppppppppppppp1234567890";
You call
writeWord("Mywordtowrite");
here is the function - it just loops through each char and calls the proper write method
void writeWord(char sWord[])
{
int i;
char *p;
p = sWord;
for(i = 0;p[ i ];i++)
{
if(isNumber(p[ i ]))
writeNumber(p[ i ]);
else
...