Step 4: Software & Code
Programming the microcontrollers
As a first step, launch the Arduino software. First of all, I think it is important to note that if the Teensy platform is used, first the TeensyDuino IDE driver has to be installed, and then paired to the Arduino IDE. More information on the procedure may be found on the Teensy site, under "Getting Started". In the case of the Teensy the panel should be connected to an available USB port, and then the Teensy Loader Application will guide you through the necessary steps. In the recommended settings a number of illustrations are included. In the case of the Arduino, following connection to the USB port, using the Arduino software open “.pde” format file that is to be programmed into the microcontroller, then using the “Upload” button the code is transferred into the microcontroller.
Whichever of the two panels are used, the microcontrollers should contain the appropriate bootloader. In the case of commercially purchased panels, the bootloader is factory programmed into the microcontrollers. When working with self-made panels, one should take care of the programming, for example using AVR Studio and different circuits to burn-in the bootloader. The Arduino has a bootloader built-in programming application, but this does not always work, but with a simple parallel programmer circuit it is very likely that we can also program our blank microcontrollers. But the simplest is to order from Ebay microcontrollers equipped with bootloader. Since these micro-controllers include the bootloader, may be used right away different projects, you only need to place them in the programming circuit, program them, and they are ready to be used.
Required settings (for the Teensy circuit)
Before using the Teensy platform, a few settings have to be taken care of.
1.Make a new sketch and copy the code in, or open an existing sketch. Before Upload, Select the “Teensy 2.0 (USB Keyboard/Mouse)” item from the Tools--Board menu.
(Make a new sketch.png photo)
2.If you see this, Loader is running and all is right:
(See this.png photo)
3.Press the button to start the bootloader, so that it looks like this:
(Press the button.png photo)
4.Upload the sketch, with “Upload” button from Arduino program (this button is signed with the play sign)!
(Upload button.png photo)
5.You should see it sucessfully program the Teensy, and reboot. The OS will then alert you that it found an HID device.
The source codes are attached at the bottom of this page.