示例#1
0
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;}
    }
}
示例#2
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;
}
示例#3
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());
}
示例#4
0
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;
}
示例#5
0
void StartPress()
{
  beep();beep();beep();
  while (!start_button());
  while (start_button());
}
示例#6
0
void start_press()
{
    while (!start_button());
    while (start_button());
    beep();
}