i'mI'm trying to squeeze code onto an attiny10ATtiny10, but i'mI'm just not getting there. i'mI'm using 1060bytes1060 bytes and only have space for 1024 bytes.
The code is simple enough; iI need to read a button pin. ifIf high it needs to pick a random value and that causes one of 2two random ledsLEDs on the pcbPCB to turn on for 2two seconds. If anyone could findIs there a way to optimize this code to work on this ic please help me so i dont need to order new pcb's 😅.IC?
int buttonState = 0;
void setup() {
pinMode(3, INPUT);
}
void loop() {
buttonState = digitalRead(3);
if (buttonState == HIGH) {
bool ranNum=random(0,1);
if(ranNum == 0) {
digitalWrite(0, HIGH);
}
else {
digitalWrite(1, HIGH);
}
delay(2000);
digitalWrite(1, LOW);
digitalWrite(2, LOW);
}
}