コード例 #1
0
ファイル: PortMonitor.cpp プロジェクト: MindMil/XCSoar
void
PortMonitorGlue::CreateButtons(ButtonPanel &buttons)
{
  buttons.Add(_("Clear"), *this, CLEAR);
  buttons.Add(_("Reconnect"), *this, RECONNECT);
  pause_button = buttons.Add(_("Pause"), *this, PAUSE);
}
コード例 #2
0
void DoLonelyModeLoop()
{
	static const unsigned int cycleTime = 100;
	static unsigned char lightMask = 0x08;
	static unsigned int lastChange = 0;

	if (millis() - lastChange > cycleTime)
	{
		lightMask = GetNextLight(lightMask);

		panel.WritePlayer1LEDs(lightMask);
		panel.WritePlayer2LEDs(lightMask);

		lastChange = millis();
	}

	if (OnePlayerButtonPressed())
	{
		LaunchOnePlayerGame();
	}
	else if (TwoPlayerButtonPressed())
	{
		LaunchTwoPlayerGame();
	}
}
コード例 #3
0
/*
void refresh_population_text (void)
{
    update_pbar (PPOP, housed_population + people_pool, 0);
}
*/
void update_avail_modules (int popup)
{
    //tell ButtonPanel to check for tech change.
    ButtonPanel* bp = getButtonPanel();
    if( bp ){
        bp->checkTech( popup );
    }
}
コード例 #4
0
void setup() 
{
	Serial.begin(9600);
	Serial.println("RA8875 start");

	/* Initialise the display using 'RA8875_480x272' or 'RA8875_800x480' */
	if (!tft.begin(RA8875_800x480)) {
	Serial.println("RA8875 Not Found!");
	while (1);
	}

	Serial.println("Found RA8875");

	tft.displayOn(true);
	tft.GPIOX(true);      // Enable TFT - display enable tied to GPIOX
	tft.PWM1config(true, RA8875_PWM_CLK_DIV1024); // PWM output for backlight
	tft.PWM1out(255);

	// With hardware accelleration this is instant
	tft.fillScreen(BLACK);
  
	pinMode(RA8875_INT, INPUT);
	digitalWrite(RA8875_INT, HIGH);

	if (readCalibrationMatrix (&_tsMatrix))
		Serial.println("Calibration is OK! :)");
	else
		Serial.println("Calibration is wrong! Repeat the process!");
  
	tft.touchEnable(true);
	panel.draw();
    
	Serial.print("Status: "); Serial.println(tft.readStatus(), HEX);
	Serial.println("Waiting for touch events ...");
}
コード例 #5
0
void setup()
{
	panel.Init();
	display.Init();

	PrintLonelyText();
}
コード例 #6
0
void loop() 
{
	tsPoint_t point;
	tsPoint_t calibrated;
	unsigned long currentMillis = millis();

	// waiting for touch events
	waitingTouchEvents(&point);

	/* Calcuate the real X/Y position based on the calibration matrix */
	calibrateTSPoint(&calibrated, &point, &_tsMatrix );

	//To avoid creating a lot of figures if you touch only once
	//It's not BLOCKING your Arduino
	if(currentMillis - previousMillis > interval){
		// save the last time you touched the button
		previousMillis = currentMillis;
		panel.OnTouch(calibrated);
	}	
	
	//if we touch button Free, we don't need to wait OnTouch event
	panel.OnDrawFree(calibrated);
}
コード例 #7
0
 void CreateButtons(ButtonPanel &buttons) {
   add_button = buttons.Add(_("Add"), *this, ADD);
   delete_button = buttons.Add(_("Delete"), *this, DELETE);
   move_up_button = buttons.AddSymbol(_T("^"), *this, MOVE_UP);
   move_down_button = buttons.AddSymbol(_T("v"), *this, MOVE_DOWN);
 }
コード例 #8
0
ファイル: WidgetDialog.hpp プロジェクト: Tjeerdm/XCSoarDktjm
 WndButton *AddButton(const TCHAR *caption,
                      ActionListener &listener, int id) {
   return buttons.Add(caption, listener, id);
 }
コード例 #9
0
ファイル: TaskListPanel.cpp プロジェクト: henrik1g/XCSoar
 void CreateButtons(ButtonPanel &buttons) {
   buttons.Add(_("Load"), *this, LOAD);
   buttons.Add(_("Rename"), *this, RENAME);
   buttons.Add(_("Delete"), *this, DELETE);
   more_button = buttons.Add(_("More"), *this, MORE);
 }
コード例 #10
0
bool TwoPlayerButtonPressed()
{
	return ((panel.ReadPlayer2Buttons() != 0) || display.GetButton2());
}
コード例 #11
0
bool OnePlayerButtonPressed()
{
	return ((panel.ReadPlayer1Buttons() != 0) || display.GetButton1());
}
コード例 #12
0
void
WeatherMapOverlayListWidget::CreateButtons(ButtonPanel &buttons)
{
  use_button = buttons.Add(_("Use"), *this, USE);
  disable_button = buttons.Add(_("Disable"), *this, DISABLE);
}