digispark/digistump ATTINY85 board keyboard compile errors
See original GitHub issue[env:digispark-tiny]
platform = atmelavr
board = digispark-tiny
framework = arduino
src/keyboard.cpp:
#include "DigiKeyboard.h"
void setup() {
DigiKeyboard.update();
}
void loop() {
delay(1000);
DigiKeyboard.update();
delay(100);
DigiKeyboard.print("hello");
DigiKeyboard.println("world");
delay(5000);
}
$ platformio run --target upload
Processing digispark-tiny (platform: atmelavr; board: digispark-tiny; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/digispark-tiny.html
PLATFORM: Atmel AVR > Digispark USB
SYSTEM: ATTINY85 16MHz 512B RAM (5.87KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 48 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <DigisparkKeyboard>
Compiling .pioenvs/digispark-tiny/src/keyboard.cpp.o
Compiling .pioenvs/digispark-tiny/lib379/DigisparkKeyboard/oddebug.c.o
Compiling .pioenvs/digispark-tiny/lib379/DigisparkKeyboard/osccal.c.o
In file included from ~/.platformio/packages/framework-arduinoavr/cores/digispark_tiny/Stream.h:24:0,
from ~/.platformio/packages/framework-arduinoavr/cores/digispark_tiny/TinyDebugSerial.h:31,
from ~/.platformio/packages/framework-arduinoavr/cores/digispark_tiny/WProgram.h:18,
from ~/.platformio/packages/framework-arduinoavr/cores/digispark_tiny/Arduino.h:4,
from ~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/DigiKeyboard.h:10,
from src/keyboard.cpp:1:
~/.platformio/packages/framework-arduinoavr/cores/digispark_tiny/Print.h:37:0: warning: "BIN" redefined
#define BIN 2
^
In file included from ~/.platformio/packages/toolchain-atmelavr/avr/include/avr/iotn85.h:38:0,
from ~/.platformio/packages/toolchain-atmelavr/avr/include/avr/io.h:428,
from ~/.platformio/packages/toolchain-atmelavr/avr/include/avr/interrupt.h:38,
from ~/.platformio/packages/framework-arduinoavr/cores/digispark_tiny/WProgram.h:8,
from ~/.platformio/packages/framework-arduinoavr/cores/digispark_tiny/Arduino.h:4,
from ~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/DigiKeyboard.h:10,
from src/keyboard.cpp:1:
~/.platformio/packages/toolchain-atmelavr/avr/include/avr/iotnx5.h:55:0: note: this is the location of the previous definition
#define BIN 7
^
In file included from ~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/DigiKeyboard.h:13:0,
from src/keyboard.cpp:1:
~/.platformio/packages/toolchain-atmelavr/avr/include/avr/delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>." [-Wcpp]
#warning "This file has been moved to <util/delay.h>."
^
Compiling .pioenvs/digispark-tiny/lib379/DigisparkKeyboard/usbdrv.c.o
In file included from src/keyboard.cpp:1:0:
~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '161' from 'int' to 'char' inside { } [-Wnarrowing]
};
^
~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '224' from 'int' to 'char' inside { } [-Wnarrowing]
~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '231' from 'int' to 'char' inside { } [-Wnarrowing]
~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '149' from 'int' to 'char' inside { } [-Wnarrowing]
~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '129' from 'int' to 'char' inside { } [-Wnarrowing]
~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '149' from 'int' to 'char' inside { } [-Wnarrowing]
~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '129' from 'int' to 'char' inside { } [-Wnarrowing]
~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/DigiKeyboard.h:59:1: error: narrowing conversion of '192' from 'int' to 'char' inside { } [-Wnarrowing]
*** [.pioenvs/digispark-tiny/src/keyboard.cpp.o] Error 1
~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/osccal.c: In function 'calibrateOscillator':
~/.platformio/packages/framework-arduinoavr/libraries/__cores__/digispark/DigisparkKeyboard/osccal.c:34:13: warning: implicit declaration of function 'usbMeasureFrameLength' [-Wimplicit-function-declaration]
x = usbMeasureFrameLength(); /* proportional to current real frequency */
^
==================================================================== [ERROR] Took 1.12 seconds ====================================================================
Which looks like 3 issues:
- redefinition of
BIN
with different values - deprecated inclusion of
delay.h
which should beutil/delay.h
- conversion of from ‘int’ to ‘char’ inside { }
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:9
Top Results From Across the Web
DigiSpark AT Tiny85 compile problem?
The resulting code compiles fine for me with the digispark core ... in the Attiny85 section of the file arduino_folder/packages/digistump/ ...
Read more >Weird error I cant find an answer for? [solved] - Arduino Forum
I am using the attiny85 to create a rickroll but I am having many many errors some of which include Error compiling for...
Read more >Compilation error with DigiKeyboard.h - Digistump
I'm using digispark attiny85 and tried some basic code like led blinking and it ... Error compiling for board Digispark (Default - 16.5mhz)....
Read more >DigiKeyboard and Bluetooth. - Digistump
And now, here is the error I am getting compiling. ... Arduino: 1.6.6 (Linux), Board: "Digispark (Default - 16.5mhz)"
Read more >Memory overload using keyboard library - Digistump
When I upload it to the digispark, it will work as long as I dont add any ... The weird thing here is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As of 2020-08-14, having the same issue 😂 alternative fix besides @bryanjhv 's, add this line to
platformio.ini
Many thanks for your tip. I was able to compile and deploy the coded after I modified the code as follows.