hi allerseits,
das progrämmchen von hermann gefält mir so gut, dass ich es als eine funktion in jedem programm haben möchte. Der aufruf:
der code selbst:Code:void WaitforStart(void); // blink until any switch is pressed, // then wait until switch is released
wie mache ich das nun?Code:void WaitforStart(void) // blink until any switch is pressed, { // then wait until switch is released uint8_t t1, t2; unsigned int col=OFF; while (1) // blinking StatusLED until any switch is pressed { t1 = PollSwitch(); t2 = PollSwitch(); if (t1==t2) { if (t1) { break; } else { col ^= GREEN; StatusLED(col); } } Msleep(50); } StatusLED(OFF); // turn off StatusLED and ... BackLED(ON,ON); // ... turn on both BackLED's while (1) // wait until switch is released { t1 = PollSwitch(); t2 = PollSwitch(); if (t1==t2) { if (!t1) { break; } } Msleep(50); } BackLED(OFF,OFF); // turn off BackLED's indication start of race }
danke schon mal für Euere tipps...







Zitieren

Lesezeichen