Teensy – why you shouldn't plug anything to your USB port

ScreenshotWe have a Teensy and we know how to write program that could type something. What we can do with that? We can input some system commands.
Most simple example would be to open notepad and then type something in it.
First thing that we have to do in our program is to wait for a while – Windows don’t always recognize plugged keyboard immediately. Then we have to press Win+R, wait, type notepad, wait again and then type whatever we want. Czytaj dalej Teensy – why you shouldn't plug anything to your USB port

Teensy for beginners – playing with keyboard

Photo by: Jeroen Bennink

We have Teensy and know how to program it. So its time to do write some code that allow us to… write something 😉 Good place to start would be usb_keyboard example from official Teensy website. There is some simple API for using keyboard that we can later modify for our needs.

Basically to press key from Teens you have to call function:

int8_t usb_keyboard_press(uint8_t key, uint8_t modifier);

where first argument is number of key (like A or 5), and second one is modifier (like Shift or Ctrl). To get key number, you can check usb_keyboard.h file, where all keys are defined as KEY*. There is also lower level functions, that allow you to, for example, to keep pressed Ctrl while pressing other keys. But I didn’t need it, so lets leave it alone.
Czytaj dalej Teensy for beginners – playing with keyboard

Teensy for beginners (like me) – first step

Teensy 2.0 on desktopRecently I bought something called Teensy 2.0. I’m still not sure why would I need it, but I will figure it out soon. What is Teensy? It is small USB Development Board that could be programmed as USB HID recognized by PC (so it can pretend to be keyboard or mouse).
I’m not an expert in such stuff, so it is new challenge to learn how to do something with it.

So what to do with such board? First thing may be to try to plug it in into USB port – if this new board, then build in LED should start blinking. But after few seconds of watching LED it gets boring. Czytaj dalej Teensy for beginners (like me) – first step