ATTINY85 doesn't work with "TinyWire.h" and "DigiKeyboard" together in the same code CAN SOMEONE HELP ME PLS?

Hi to everyone!
That's my first post here.
I'm trying to write presaved messages controling a digispark attiny85 using i2c communication with an esp01 in AP mode to control the system via smartphone.
Doing some tests I can now do everything I wanted to do but now, after adding the DigiKeyboard commands and lib, when I tried uploading the code I got this error..

C:\Users\10293_~1\AppData\Local\Temp\arduino_build_994554\libraries\TinyWire-master\twi.cpp.o: In function `__vector_2':
C:\Users\10293_000\Documents\Arduino\libraries\TinyWire-master/twi.cpp:822: multiple definition of `__vector_2'
C:\Users\10293_~1\AppData\Local\Temp\arduino_build_994554\libraries\DigisparkKeyboard\usbdrvasm.S.o:C:\Users\10293_000\Documents\ArduinoData\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard/usbdrvasm165.inc:41: first defined here
collect2.exe: error: ld returned 1 exit status
Using library DigisparkKeyboard in folder: C:\Users\10293_000\Documents\ArduinoData\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard (legacy)
Using library TinyWire-master in folder: C:\Users\10293_000\Documents\Arduino\libraries\TinyWire-master (legacy)
exit status 1
Error compiling for board Digispark (Default - 16.5mhz).

Can someone help me to solve this pls?

Here's also the attiny85 code (I don't think it's a problem related to the esp01 code so i think that the attiny85 one could be enough)

#include "KeyboardIT.h"
#include <TinyWire.h>
#define own_address 9

void setup()
{
TinyWire.begin(own_address);
TinyWire.onReceive(comando);
pinMode(0, OUTPUT); //LED on Model B
pinMode(1, OUTPUT); //LED on Model A or Pro
}

void loop()
{
}

void comando(int dato)
{
while (TinyWire.available())
{
char c = TinyWire.read();
if(c=='1')
{
digitalWrite(0, HIGH);
digitalWrite(1, HIGH);
}
else if(c=='2')
{
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(2000);
DigiKeyboard.sendKeyStroke(KEY_H);
DigiKeyboard.delay(2000);
DigiKeyboard.sendKeyStroke(KEY_E);
DigiKeyboard.delay(2000);
DigiKeyboard.sendKeyStroke(KEY_L);
DigiKeyboard.delay(2000);
DigiKeyboard.sendKeyStroke(KEY_L);
DigiKeyboard.delay(2000);
DigiKeyboard.sendKeyStroke(KEY_O);
DigiKeyboard.delay(2000);
for(;;){ /empty/ }
}
else if(c=='0')
{
digitalWrite(0, LOW);
digitalWrite(1, LOW);
}
}
delay(500);
}

Both libraries use the same interrupt which isn't possible.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.