The first example sketch (LED Blink) works fine but when I try the Keyboard example sketch it throws some errors.
Here is the code:
#include "DigiKeyboard.h"
void setup() {
// don't need to set anything up to use DigiKeyboard
}
void loop() {
// this is generally not necessary but with some older systems it seems to
// prevent missing the first character after a delay:
DigiKeyboard.sendKeyStroke(0);
// Type out this string letter by letter on the computer (assumes US-style
// keyboard)
DigiKeyboard.println("Hello Digispark!");
// It's better to use DigiKeyboard.delay() over the regular Arduino delay()
// if doing keyboard stuff because it keeps talking to the computer to make
// sure the computer knows the keyboard is alive and connected
DigiKeyboard.delay(5000);
}
In file included from c:\users\alex\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
from C:\Users\Alex\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbportability.h:121,
from C:\Users\Alex\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrvasm.S:19:
C:\Users\Alex\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrv.h:662:33: error: operator '*' has no left operand
define USB_INTR_PENDING GIFR
^
C:\Users\Alex\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrvasm.S:74:5: note: in expansion of macro 'USB_INTR_PENDING'
#if USB_INTR_PENDING < 0x40 /* This is an I/O address, use in and out */
^
exit status 1
Error compiling for board Digispark (Default - 16.5mhz).
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I tried reinstalling the Board but sadly nothing.
Any ideas what is wrong?
from C:\Users\Alex\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbportability.h:121,
from C:\Users\Alex\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrvasm.S:19:
C:\Users\Alex\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrv.h:662:33: error: operator '*' has no left operand
define USB_INTR_PENDING GIFR
^
C:\Users\Alex\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrvasm.S:75:5: note: in expansion of macro 'USB_INTR_PENDING'
#if USB_INTR_PENDING < 0x40
^
Using library DigisparkKeyboard in folder: C:\Users\Alex\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard (legacy)
exit status 1
Error compiling for board Digispark (Default - 16.5mhz).
The error was already there, but it was silently ignored.
(included in arduino-bulder 1.4.0 which is in IDE 1.8.6)
Improve error handling in include detection
For include detection, the preprocessor is run on all source files,
collecting #included filenames from the stderr output, each of which are
then resolved to a library to include. A caching mechanism is used to
only run the preprocessor when needed.
This commit improves the error handling during include detection in a
number of ways:
When the preprocessor runs succesfully, processing stops for the
current file. Previously, it would always look at stderr to find a
missing include filename and only stop if none was found.
- When the preprocessor fails, but no filename can be found, show the
** error preprocessor error. Previously, it would assume that the**
** process was done and stop processing the file without any error.**
When no library can be found for a missing include, show the stored
error output instead of running the preprocessor again. Previously,
the preprocessor would be run a second time, to (re)generate the
error message.