/*********************************************************************** * * Slave-Flash with Attiny24 * * Description: * A photo-diode registers a flash and counts an internal counter * if the counter reaches the limit an second flash is triggered. * * Ports: * PB3 Reset, active low, 10k to VCC, pushbutton to GND * PB2 Interrupt int0, active high, 2.2n capacitor to photo-diode-resistor voltage divider * PB1 Unused * PB0 Unused * PA7 Unused * PA6 Unused * PA5 fire * PA4 statusled * PA3 16bit-selectorD * PA2 16bit-selectorC * PA1 16bit-selectorB * PA0 16bit-selectorA * * Current usage: 2mA in Idle-Mode, 10mA with LED * * Date: 19.6.2011 andyk75 for instructables ***********************************************************************/ #ifndef F_CPU // #warning "F_CPU was not defined, is now set to 1MHz" #define F_CPU 1000000UL // Systemclock in Hz - Definition as unsigned long #endif #include #include #include #include #include #include "slaveflash.h" // project specific definitions void init(void) { // Adjust the ports and the direction registers statusledport &= ~(1<