Okay habe alles angeschlossen jedoch erhalte beim upload this:
Sketch to big...
Code :int ledPin[3]={2,3,4};
int sourceValue[3]={0,0,255};
int targetValue[3]={0,0,0};
int currentPos = 0;
int button = 21;
void setup() {
for (int i = 0; i < 3; i++) {
sourceValue[i]=random(255);
targetValue[i]=random(255);
pinMode(ledPin[i], OUTPUT);
pinMode(button, INPUT);
}
}
void loop () {
if(digitalRead(button) == 1) {
fade();
}
}
void fade(){
for (int i = 0; i < 3; i++) {
int helligkeit = (sourceValue[i]*(128-currentPos)+targetValue[i]*currentPos)/128;
analogWrite(ledPin[i],helligkeit);
}
currentPos++;
if (currentPos > 128) {
for (int i = 0; i < 3;i++){
sourceValue[i] = targetValue[i];
targetValue[i] = random(255);
}
currentPos = 0;
}
delay(10);
}
sofern ich einen kleinen testcode schreibe sagt das board:
Could not find USB device 0x1781/0xc9f
Board ist im programm ausgewählt: Arduino-ATtiny2313