// Copied from Rab Hart's code that was //Shamelessly copied and mofied from Neil Gershenfeld's for purposes of instruction. //This cycles the color pattern of LEDs in response to button press //For the ATTINY44 // Button PA2 (pin 8). // RED PA7 (pin 5). // GREEN PA6 // BLUE PA5 #include //this includes all definitions of registers and bits of registers, including pins and port names. #define output(directions,pin) (directions |= pin) // set port direction for output #define input(directions,pin) (directions &= (~pin)) // set port direction for input #define set(port,pin) (port |= pin) // set port pin #define clear(port,pin) (port &= (~pin)) // clear port pin #define pin_test(pins,pin) (pins & pin) // test for port pin #define bit_test(byte,bit) (byte & (1 << bit)) // test for bit set #define input_port PORTA // The button is on port A #define input_direction DDRA // DDRA defines input/output for port A #define input_pin (1 << PA2) // The button is on pin 5 of port A (1<