示例#1
0
bool DBBitmapHelper::IsStartButtonClicked()
{
	bool result = false;

	if (IsButtonClicked(startButtonID))
	{
		dbSetSpritePriority(startButtonID,-1);
		result = true;
	} 
	return result;     
}
示例#2
0
void loop() {
  // put your main code here, to run repeatedly:

  /*Blink around every 0.5 sec*/
  counter++;
  int irda_status = IrdaSensor->IRDATransmit(&counter, 1, 100 );
  if(irda_status != 0)
  {
    Serial.println("Unable to transmit through IRDA");
  }

  if(counter > 5)
  {
      digitalWrite(LED_WIFI, led);
      digitalWrite(LED_AZURE, led);
      digitalWrite(LED_USER, led);
      led = !led;
    
      rgbLed.setColor(_rgb[color].red, _rgb[color].green, _rgb[color].blue);
      color = (color + 1) % (sizeof(_rgb) / sizeof(struct _tagRGB));
      counter = 0;
  }
 
  if(IsButtonClicked(USER_BUTTON_A))
  {
      showWiFi = true;
      buttonClicked = true;
      delay(50);
  }
  else if(IsButtonClicked(USER_BUTTON_B))
  {
      status = (status + 1) % NUMSENSORS;
      showWiFi = false;
      buttonClicked = true;
      delay(50);
  }

  if(!buttonClicked)
  {
    Screen.print(title);
    return;
  }

  if(showWiFi)
  {
    if(!isConnected)
    {
      InitWiFi();
      isConnected = true;
    }
    else
    {
      Screen.print(wifiBuff);
    }
  }
  else
  {
    switch(status)
    {
        case 0:
            showHumidTempSensor();
            break;
        case 1:
            showPressureSensor();
            break; 
        case 2:
            showMagneticSensor();
            break;
        case 3:
            showMotionGyroSensor();
            break;
    }
  }
}