void PortMonitorGlue::CreateButtons(ButtonPanel &buttons) { buttons.Add(_("Clear"), *this, CLEAR); buttons.Add(_("Reconnect"), *this, RECONNECT); pause_button = buttons.Add(_("Pause"), *this, PAUSE); }
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(); } }
/* 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 ); } }
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 ..."); }
void setup() { panel.Init(); display.Init(); PrintLonelyText(); }
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); }
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); }
WndButton *AddButton(const TCHAR *caption, ActionListener &listener, int id) { return buttons.Add(caption, listener, id); }
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); }
bool TwoPlayerButtonPressed() { return ((panel.ReadPlayer2Buttons() != 0) || display.GetButton2()); }
bool OnePlayerButtonPressed() { return ((panel.ReadPlayer1Buttons() != 0) || display.GetButton1()); }
void WeatherMapOverlayListWidget::CreateButtons(ButtonPanel &buttons) { use_button = buttons.Add(_("Use"), *this, USE); disable_button = buttons.Add(_("Disable"), *this, DISABLE); }