Can an Arduino UNO and Arduino Leonardo do the same things?
Some of the examples in the Arduino software say to use Leonardo e.g. KeyboardMessage.
Can an Arduino UNO and Arduino Leonardo do the same things? Some of the examples in the Arduino software say to use Leonardo e.g. KeyboardMessage. |
||||
migrated from electronics.stackexchange.com Jun 18 at 16:20This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts. |
||||
|
No, the Uno and the Leonardo cannot do the same thing. The Leonardo is a single MCU directly connected to the USB port. It is down to the software on that MCU as to how it communicates (what it enumerates as) on the USB bus. The Uno, conversely, is a dual MCU system. It has the "main" MCU (the ATMega328P) which is what you program, and that communicates to the USB port via another MCU. The two MCUs are connected using TTL RS-232 (UART), so the only communication you have with your computer is through the Serial object. There are benefits and problems with both approaches. The benefits of the Leonardo are that you can emulate keyboards, mice, etc. The down side is that the whole USB communication is more fragile and is at the mercy of the user. The Uno's benefits are that the USB serial is always connected and available regardless of the state of the main MCU, which is much more friendly from the PC's point of view. The down side is that it severely limits your communication options. |
|||
|
Yes you can, but not with that library. This method is a little advanced and requires you to upgrade a different type of firmware to your second MCU on your Uno. (The full tutorial is available here) Example code from the tutorial link shown above (for process outlined below):
Here's what you need to do:
Type this line (Still, Mac or Linux only):
Unplug/plug in your board and enjoy! Note: you'll have to flash the standard firmware to upload a new sketch and the flash the keyboard firmware again to get this to work. |
|||
|