Rearranged examples

This commit is contained in:
Nico 2014-11-22 12:59:13 +01:00
parent a2ba6fde68
commit e03c73f396
6 changed files with 42 additions and 4 deletions

View file

@ -66,7 +66,7 @@ void loop() {
}
//================================================================================
// NHP
// HoodLoader1 compatible NHP sending API
//================================================================================
// Start Mask

View file

@ -0,0 +1,36 @@
/*
Copyright (c) 2014 NicoHood
See the readme for credit to other people.
HoodLoader2 NoUSB Blink example
This sketch demonstrates how to use HoodLoader2 without USB Core.
This might be useful to keep ram/flash usage at a very low level.
Select Tools->USB Core->No USB functions to get rid of the USB Core.
Blinks Leds and shows what workaround is needed to get the timing correct.
You can still use the normal digitalWrite(LED_BUILTIN_TX, LOW); for updating Leds.
Keep in mind that the logic is inverted then! LOW=HIGH and vice versa.
*/
// workaround for undefined USBCON has to be placed in every sketch
// otherwise the timings wont work correctly
ISR(USB_GEN_vect)
{
UDINT = 0;
}
void setup() {
TX_RX_LED_INIT;
}
void loop() {
TXLED0;
delay(100);
TXLED1;
delay(100);
RXLED0;
delay(100);
RXLED1;
delay(100);
}

View file

@ -4,13 +4,15 @@
HoodLoader2 SerialKeyboard example
This sketch should demonstate how to program a basic sketch with HoodLoader2.
This sketch should demonstrate how to program a basic sketch with HoodLoader2.
It was used to demonstrate that Serial and HID is working properly.
The the other examples on how to use the other APIs, it works the same.
Use the F() macro to save strings in PROGMEM to keep ram usage low.
The 16u2 has very low RAM, so don't try to use that much ram.
Open the Serial port, type in anything and see that Serial and Keyboard is working.
See official documentation for more infos.
Use the F() macro to save strings in PROGMEM to keep ram usage low.
*/
void setup() {