static void application__init(void) { led1__init(); led2__init(); led3__init(); led4__init(); buttons_handler__init(); }
void application__init(void) { led1__init(); PORTC |= ((1<<PINC4) | (1<<PINC5)); TWDR = 0x00; // Default Initial Value twi__slave_address__set(1); twi__slave__thread__init(); }
void application__init(void) { led1__init(); // init I2C PORTC |= ((1 << PINC4) | (1 << PINC5)); TWDR = 0; twi__slave_address__set(0x1F); twi__slave__thread__init(); }
int main(void) { ENABLE_PULLUP(IN__BUTTON1); ENABLE_PULLUP(IN__BUTTON2); ENABLE_PULLUP(IN__BUTTON3); ENABLE_PULLUP(IN__BUTTON4); ENABLE_PULLUP(IN__BUTTON5); ENABLE_PULLUP(IN__BUTTON6); ENABLE_PULLUP(UNUSED_D0); ENABLE_PULLUP(UNUSED_D1); led1__init(); led2__init(); led3__init(); while(1) { uint8_t state = IN(IN__BUTTONS) & (_BV(IN__BUTTON1__PIN) | _BV(IN__BUTTON2__PIN) | _BV(IN__BUTTON3__PIN) | _BV(IN__BUTTON4__PIN) | _BV(IN__BUTTON5__PIN) | _BV(IN__BUTTON6__PIN)); if (!(state & _BV(IN__BUTTON1__PIN))) { led1__set(1); led2__set(0); led3__set(0); } else if (!(state & _BV(IN__BUTTON2__PIN))) { led1__set(0); led2__set(1); led3__set(0); } else if (!(state & _BV(IN__BUTTON3__PIN))) { led1__set(1); led2__set(1); led3__set(0); } else if (!(state & _BV(IN__BUTTON4__PIN))) { led1__set(0); led2__set(0); led3__set(1); } else if (!(state & _BV(IN__BUTTON5__PIN))) { led1__set(1); led2__set(0); led3__set(1); } else if (!(state & _BV(IN__BUTTON6__PIN))) { led1__set(0); led2__set(1); led3__set(1); } else { led1__set(0); led2__set(0); led3__set(0); } _delay_ms(50); } }
static void application__init(void) { ENABLE_PULLUP(UNUSED_D0); ENABLE_PULLUP(UNUSED_D1); ENABLE_PULLUP(UNUSED_D2); ENABLE_PULLUP(UNUSED_D3); ENABLE_PULLUP(UNUSED_D4); ENABLE_PULLUP(UNUSED_B3); ENABLE_PULLUP(UNUSED_B4); ENABLE_PULLUP(UNUSED_B5); button1__init(); button2__init(); button3__init(); button4__init(); button5__init(); button6__init(); led1__init(); led2__init(); led3__init(); led4__init(); led5__init(); led6__init(); }