int main(void){ struct Motor MtestM; M0 = &MtestM; cli(); pinSetup(); initialize(); motorObjectSetup(M0); M0->maxRevolutionsRight=50; M0->maxRevolutionsLeft = -50; M0->targetDirection = LEFT; M0->running = TRUE; pollMotor(M0); /* PORTB |=(1<<PB7); _delay_ms(500); PORTB &= ~(1<<PB7); _delay_ms(500); PORTB |= (1<<PB7); _delay_ms(500); PORTB &= ~(1<<PB7); _delay_ms(500); */ sei(); while(1){ pollMotor(M0); } return 0; }
// main method int main(void) { pinSetup(); timer0Setup(); sei(); for(;;) { // idle } return 0; /* never reached */ }
int main(void) { pinSetup(); timer0Setup(); sei(); // ------ Event loop ------ // while (1) { // idle } // This line is never reached return 0; }
// program setup void setup() { Serial.begin(115200); pinSetup(); sensorSetup(); I2CSetup(); USBsetup(); driveSetup(); disp.addEventListener(Events::EV_TIME_1000, timeHandler1000); //disp.addEventListener(Events::EV_TIME_1000, usbSoftwareTestHandler); disp.addEventListener(Events::EV_TIME_1000, IRSensorHandler); //disp.addEventListener(Events::EV_TIME_1000, I2CSensorDataHandler); disp.addEventListener(Events::EV_TIME_500, timeHandler500); //disp.addEventListener(Events::EV_TIME_100, timeHandler100); //disp.addEventListener(Events::EV_ANALOG0, analogHandler); disp.addEventListener(Events::EV_SERIAL, USBReadHandler); }