Run arduino in administrator mode. Otherwise Attiny’s drivers will have problems.
First, enter the following in the Arduino preferences:
http://digistump.com/package_digistump_index.json
Copy the code
To increase support for Attiny85.
Then in the Development board Manager, search for Digistump, find the option called Digistump AVR Boards, and click Install in the lower right corner.
After that, you can choose this board.
At this point, plug in attiny85 and right click on my computer to open Device Manager.
If you have an unknown device, you need to install a driver. Download: github.com/micronucleu…
Double-click the unknown device to go to the details page.
Then install the driver. Pay attention to the red box, keep consistent, so as not to replace the normal driver.
Then install libusb-win32, drop down list change winUSB to libusb-win32. Then click Replace Driver.
Once installed, reinstall the Attiny85 development board.
In device Manager, you can see that the unknown device is running under libusb-Win32 devices.
#include "DigiKeyboard.h"
int buttonState = 0;
void setup() {
pinMode(1, INPUT_PULLUP);
pinMode(2, OUTPUT);
//pinMode(3, OUTPUT);
digitalWrite(2, HIGH);
}
void loop() {
buttonState = digitalRead(1);
if (buttonState == HIGH) {hELLO dIGISPARK!
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.println("123456"); DigiKeyboard.sendKeyStroke(KEY_ENTER); }}Copy the code
Then click Upload and Plug in Device Now… “, plug and unplug the attiny85.
At this point, it can be used to boot.