- Notifications
You must be signed in to change notification settings - Fork26
Palatis/Arduino-Lufa
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
=========================
LUFA (Lightweight USB For AVRs) on the Arduino!
Modern Arduinos (Arduino Leonardo,Arduino Micro,Arduino Esplora,Arduino Lilypad USB, and the UpcomingArduino Tre) came with a ATmega32u4 which have a native USB interface on the MCU. The Arduino IDE also came with a tiny USB stack that has a USB CDC Serial, a Keyboard, and a Mouse. It might be enough if you're migrating old projects (form ATmega168/328's) to the new hardware, but when you want to unleash the full power of it, you'd find that the current implementations lasks extensibility (BADLY!).
Thus, I managed to bring the powerfulLUFA to Arduino!
As LUFA requires changes to the Arduino core files, it is installed as custom boards.
In the Arduino IDE, go toFile > Preferences
, and inAdditional Boards Manager URLs
add the following entry :https://github.com/Palatis/Arduino-Lufa/raw/master/package_arduino-lufa_index.json
Restart Arduino IDE, and you should be able to findArduino LUFA AVR Boards
in theTools > Board > Boards Manager
Click on install, andArduino LUFA AVR Boards
should now appear as a submenu inTools > Board
While not recommended, it is still possible to use thelegacy installation method.
To test Arduino-Lufa, select your board type from theTools > Board > Arduino LUFA AVR Boards
, and open theFile > Examples > Exemple for this board > Arduino-LUFA > LUFA_DualVirtualSerial
example.
ClickVerify.
(Note: only atmega32u4 based boards are marked as compatible and will appear, if youare using another board which should be compatible please open an issue. Also see Note onUpload below)
To use Arduino-Lufa, select a LUFA board and add#include <LUFA.h>
to your sketch header.
By uploading this sketch to the board, you will prevent the Arduino IDE from automatically reset the board before uploading another sketch. This is normally done by setting up a seial connection with 1200 baud, connecting, then disconnecting.
You can, however, manually reset the board by pressing the hardware reset button when the upload starts. To better see this, enable "Show verbose output during upload" in your preferences and wait until the IDE repatedly prompts something like this:
PORTS {COM1, COM5, COM6, } / {COM1, COM5, COM6, } => {}
If done correctly, the LED on pin 13 will begin flashing and you'll see the upload progressing in the console.
This is not permanent, however. To go back to the original state, upload a sketch compiled without Arduino-Lufa, as explained below.
If you need to compile sketches that use the Arduino Core USB Stack, you'll need to select the board type fromtheTools > Board > Arduino AVR Boards
submenu.
Refer tolegacy installation document if you previously installed using the legacy method and wish to deactivate Arduino-Lufa
- Victor Tseng: palatisAT gmailDOT com (Original Author)
- Daniel Korgel (Contributor)
- Felix Uhl (Contributor)
- CrazyRedMachine (Contributor)
- Arduino:http://arduino.cc
- LUFA:http://www.fourwalledcubicle.com/LUFA.php
The MIT License (MIT)Copyright (c) 2014, Victor TsengPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.
About
LUFA (Lightweight USB For AVRs) on the Arduino!