Recently I'm trying to make a simple LED controller with ATTiny85/Digispark.
I tried to use DigiCDC
lib to perform data IO
but it does not work on my PC (win10 x64).
test code:
#include <DigiCDC.h>
void setup()
{
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
SerialUSB.begin();
SerialUSB.println("hello world");
}
void loop()
{
digitalWrite(0, HIGH);
digitalWrite(1, HIGH);
delay(200);
digitalWrite(0, LOW);
digitalWrite(1, LOW);
delay(800);
SerialUSB.println("ping");
int ava = SerialUSB.available();
int buffer[ava];
// read buffer
for(int step = 0; step < ava; step++)
buffer[step] = SerialUSB.read();
// write buffer back
for(int step = 0; step < ava; step++)
SerialUSB.print(buffer[step]);
SerialUSB.println("==line end==");
delete buffer;
}
Official demo mentioned here (Arduino IDE - Files - Examples - DigiCDC - Echo) also did not work.
Once program is compiled and uploaded onto board, Windows shows a "Unknown USB device" notification. And no usable serial port devices can be found.
- Are there missing some drivers?
- Or
DigiCDC
lib is simply not working on Win10? - Or I should use another lib to achieve communication between PC and ATTiny85/Digispark via USB?