Skip to content

HoodLoader2 ready to use – USB HID for Arduino Uno Mega

NicoHood edited this page May 5, 2016 · 1 revision

Extracted from the old Wordpress blog.

header

I am proud to announce that the new HoodLoader2 is ready for use. With HoodLoader2 you can turn your Arduino Uno/Mega into USB devices such as Keyboard, Mouse, Gamepads and more. Click the read more button to get more information.

It is not simply an update from HoodLoader1, it is a whole different piece of Software with a lot more possibilities. HoodLoader2 gives you the option to reprogram the 16u2 of a normal Arduino Uno/Mega R3 with custom sketches. This means you can use the 16u2 as a normal USB AVR like a Leonardo. You have a full compatible USB-HID core, CDC Serial and you can also use the 7 i/o pins of the 16u2. The extended HID devices and USB-Core improvements of the HID Project also apply for the HoodLoader2. (The HID Project also got a lot of new updates lately, also check it out for Arduino Leonardo/Micro.) The great thing about this is that you actually have two fully Arduino compatible Microcontrollers in one Arduino Uno/Mega board - the board most of you already own. Your main MCU (328/2560) is still reprogrammable if you enter bootloader mode. All you need for this is a normal Arduino Uno/Mega R3 and some cables to install the new HoodLoader2. In this post I will mostly describe what you can do with the new HoodLoader2 and what you simply can't. A good overview of the 16u2 features is also in the Github readme. So read on :)

The best way to get more information about HoodLoader2 is to just visit the Github page and see the Readme. All new functions are described there in detail and its the most up to date source. First i have to say that the 16u2 is not the most powerful AVR as you can imagine. For the Arduino its only used as USB-Serial bridge. But you can still do more with it, if you know what you are using. The 16u2 has only 500 bytes ram and 16kb flash (of which 4kb are used by the HoodLoader2). So you have to program resource friendly. It might not be that useful for beginners cause you might run out of ram if you aren't carefully/resource unfriendly. Keep this always in mind. Nevertheless with a whole Arduino compatible AVR you can still do a lot of great stuff. First of you can use the great extended USB-Core of the HID Project with new HID devices such as Media Control or a Gamepad. You can use your Arduino Uno/Mega as a Media Player control. Whether you control the Media with the main MCU and send controls to the 16u2 via Serial or code the whole thing on the 16u2, thats up to you! For example my IRLremote library for receiving and sending Infrared signals is also useable with HoodLoader2. You have up to 7 usable i/o pins on a normal Arduino R3 board. You can connect sensors or control things with the 16u2 as well. The 16u2 can communicate with the main MCU (328/2560) via Serial and also reset it. They could play together in many different ways. SPI pins are also usable. This means you can use FastLED with HoodLoader2! Connect some Leds to your 16u2 might be very useful since the SPI chipset leds needs SPI. And my Arduino shields also need SPI and then you cannot use both at the same time. Or you have to use the bitbang method (which also works great with this lib for sure) which i don't prefer. So you could use Arduino shield and SPI LEDs at the same time. Furthermore you could realize a full Ambilight control via CDC Serial and Adalight(also with Hyperion and a Raspberry Pi) which is independent from the main MCU. This frees up space and calculation time of the main MCU. With the main MCU as mentioned above you can send control signals via Serial to turn on/off the Ambilight program of the 16u2. Or switch the Led visualizations which are implemented on the 16u2. Without the USB-Core you can also get even more free flash and ram for Led visualizations. With the compatible IRLremote you could also create some Media control. When the 16u2 receives special signals you could press special USB Keys to control a Media Center, Music Player or even a game. Or use the 16u2 to control both: PC and main MCU with the IR signals. My concrete plan is to receive IR signals with the 16u2, control my XBMC media center. The 16u2 also has 50 WS2801 Leds which are used for Ambilight. As you can imagine the media center is running on a Raspberry Pi with Hyperion and the Adalight Serial output. Optionality i will add some visualizations. Since the 16u2 has no analog input i will use the main MCU to stream analog signals from my MSGEQ7 music analyzer. The streaming will be done with the NHP which i have to update soon (always wanted to do this). And to finalize this project I will use a standard Arduino Uno in my Lego Case (on top of my Smarti Pi case) ;D The main MCU then has no real function for now, so i will test my Ethernet, TFT Display, and Yun shield. Its time to use them now that i've bought them. Get ready for an IRC chat library and some more great stuff sooner or later ;) As you can see that' what i was working on the past 3/4 year. I've done a lot of different libraries with a main goal in my head. I hope you found something useful on my blog and have a lot of fun with your hacking. ~Nico

Clone this wiki locally