SAO Instructions

I sell on Tindie

Pinout for version 1.0.0 – 1.0.1

Unfortunatly I did this backwards. Newer boards 1.0.2 and up will have this corrected.

Arduino

You can use the Arduino to program the board. However in order to program this directly you will need a 8mhz crystal on pin 2 and 3 of the ATtiny85.

ATtiny Header AVR

You might want to look at these articals for more information on prgraming an ATTiny84

Program a ATtiny85 SOIC 8 using an Arduino

ATtiny breadboard headers (ATtiny 45/25/85)

Arduino Code

/*
Rick Head

Darren Mason
bitcows.com
10/29/2019

*/
#include 

int looptype = 0;
int button = 4; //IO4 pin 3
int orange = 2; //IO1 pin 7
int green = 3; //IO3 pin 2
int state = HIGH;
int r;
int p = LOW;
long time = 0;
long debounce = 200;

CapacitiveSensor cs_2_4 = CapacitiveSensor(5, button); // 1M resistor between pins


void setup()
{
    
    pinMode(orange, OUTPUT);
    pinMode(green, OUTPUT);
    pinMode(button, INPUT);
}

void touch()
{

    r = digitalRead(4);
    if (r == HIGH && p == LOW && millis() - time > debounce) {
        
        if (state == HIGH)
            state = LOW;
        else
            state = HIGH;
        time = millis();
        
        if (state == HIGH) {
            if (looptype == 0)
                looptype = looptype + 1;
            else if (looptype == 1)
                looptype = looptype + 1;
            else if (looptype == 2)
                looptype = looptype + 1;
            else
                looptype = 0;
        }
        delay(500);
    }

    p = r;
}

void loop()
{

    if (looptype == 0) { //blink orange and green
        digitalWrite(orange, HIGH);
        delay(200);
        digitalWrite(orange, LOW);
        delay(200);
        digitalWrite(green, HIGH);
        delay(200);
        digitalWrite(green, LOW);
      
    } else if (looptype == 1) { //hyperflash both
        digitalWrite(orange, HIGH);
        digitalWrite(green, HIGH);
        delay(20);
        digitalWrite(orange, LOW);
        digitalWrite(green, LOW);
        delay(20);
    } else if (looptype == 2) { //blink Green
        digitalWrite(green, HIGH);
        delay(100);
        digitalWrite(green, LOW);
        delay(100);
    } else { //slow flash both
        digitalWrite(orange, HIGH);
        delay(100);
        digitalWrite(orange, LOW);
        delay(100);
    }

    touch();

}
Loading Facebook Comments ...