0

I made a simple test sketch to make my ATTiny85 emulate a Keyboard and send a sequence of keystrokes.

#include "DigiKeyboard.h"
void setup() {
  // don't need to set anything up to use DigiKeyboard
}

void loop() { DigiKeyboard.delay(1000); DigiKeyboard.sendKeyStroke(0); DigiKeyboard.sendKeyStroke(106); // F15 DigiKeyboard.delay(59 * 1000); }

It worked fine, but now every time I plug it to the USB port on my computer, Windows detects it as a Keyboard and starts typing what I programmed it to type.

Arduino IDE can't reprogram it. When it says "Plug in device now", I do it, but it immediately acts like a Keyboard, not like a programmable ATTiny85.

Arduino IDE

Note: Image shows the console output. Code is just a simple blinker.

Is there any way to save this board? I just want to upload another sketch to it. Maybe some way to rewrite the bootloader or to erase the flash memory entirely.

Also, please give me some advice so I can avoid being locked out again in the future. I really want to use this board as a Keyboard emulator, but I want to be able to reprogram it if necessary.

ATTiny85

1 Answers1

2

If you can't access the bootloader using USB your remaining option is ISP/ICSP (In-Circuit Serial Programming). I have that digispark board and I have never been able to program it using Arduino's IDE/USB. However, since then I always use both an USBasp programmer and the AVRDUDESS programming tool. With them you can eassily program the controller (they have never failed me). Connect the SPI, +5V, GND and RESET connectors from the ATTINY85 to the programmer, compile the code, program the binaries with AVRDUDESS and voila.

jcfgonc
  • 21
  • 4