/* * decision_box_be.c * * Created: 15.03.2015 * Author: nqtronix * Package: Decision Box BE * ID: 430456905935 * Version: 1.0 * Release: 17.03.2015 * License: BY-NC-SA * * Content: * - decision_box.c (program)[this] * - pinout.h (maps IO) * - user.h (user defined values) * * Description: * This program is a remake of the "Arduino decision box V2.0 (Attiny85)" by * Victor8o5: http://www.instructables.com/id/Arduino-decision-box-V20-Attiny85/ * The code is pin-compatible to the latest version at release, but not feature * identical. For more information check the corresponding instructable "'Arduino' * Decision 'Box' BE (Attiny85)": * http://www.instructables.com/id/Arduino-Decision-Box-BE-Attiny85/ * * DO NOT MODIFY THE MAPPING WITHIN THE MAIN C FILE. Modify the pinout.h * DO NOT MODIFY THE VALUES WITHIN THE MAIN C FILE. Modify the user.h */ #include #include #include #include #include "pinout.h" //load pin mapping #include "user.h" //load user defined values //global variables uint8_t button_press = 0; //button pressed if low uint8_t preSleep_MCUCR = 0; //contains contents of MCUCR prior sleep uint8_t debounce = 0; //= 1 if button recently pressed/released uint8_t isr_PCINT0 = 0; //= 1 if interrupt executed uint8_t isr_WDT= 0; //= 1 if interrupt executed //forward decelerations uint8_t randomByte(); int main(void) { //Initialize LEDs DDR_LED |= ((1< 255-PERCENTAGE_RED) //chance for "YES" / RED PORT_LED |= (1<>8); } ISR(PCINT0_vect) { isr_PCINT0 = 1; } ISR(WDT_vect) { isr_WDT = 1; }