int YesNo(char st[]) { printf("%s? (Start=Y, Stop=N):\n", st); while (1) { if (start_button()) {while (start_button()); return 1;} if (stop_button()) {while (stop_button()); return 0;} } }
int FDispMenu(int funcSel, char stMenu[]) { if (func != funcSel) return 0; if (start_button() && func == funcLast) { while (start_button()); func = -1; return 1; } if (func != funcLast) printf("%s\n", stMenu); return 0; }
void ServoRange() { int pos; int portServ = 0; while (!stop_button()) { if (start_button()) { portServ = 1 - portServ; while (start_button()); } pos = ScaleKnob(30, 3960); printf("Servo: %d\n", pos); servo(portServ, pos); } while (stop_button()); }
int WSetting(char st[], int wMin, int wMax) { int wSet; int wSetLast = -1; while (!start_button()) { wSet = ScaleKnob(wMin, wMax); if (wSet != wSetLast) { wSetLast = wSet; printf("%s: %d\n", st, wSet); } } while (start_button()); return wSet; }
void StartPress() { beep();beep();beep(); while (!start_button()); while (start_button()); }
void start_press() { while (!start_button()); while (start_button()); beep(); }