#include "UI_ArduinoPhone.h"
#include "UI_ArduinoPhone.h"
#include <SeeedTouchScreen.h>
#include <stdio.h>
#include <Wire.h>
#include <Arduino.h>
#include "UI_ArduinoPhone_dfs.h"

#include <TFT.h>
#include <SPI.h>

TouchScreen ts = TouchScreen(XP, YP, XM, YM);

const short __xyButton[12][2] PROGMEM = {
    {KB_X1, KB_Y1},{KB_X2, KB_Y1},{KB_X3, KB_Y1},
    {KB_X1, KB_Y2},{KB_X2, KB_Y2},{KB_X3, KB_Y2},
    {KB_X1, KB_Y3},{KB_X2, KB_Y3},{KB_X3, KB_Y3},
    {KB_X1, KB_Y4},{KB_X2, KB_Y4},{KB_X3, KB_Y4}

};

void UI_ArduinoPhone::drawButton(int x, int y)
{
    unsigned char up1[3]    = {KB_BUTTON_COLOR_UPR1, KB_BUTTON_COLOR_UPG1, KB_BUTTON_COLOR_UPB1};
    unsigned char down1[3]  = {KB_BUTTON_COLOR_DOWNR1, KB_BUTTON_COLOR_DOWNG1, KB_BUTTON_COLOR_DOWNB1};
    unsigned char up2[3]    = {KB_BUTTON_COLOR_UPR2, KB_BUTTON_COLOR_UPG2, KB_BUTTON_COLOR_UPB2};
    unsigned char down2[3]  = {KB_BUTTON_COLOR_DOWNR2, KB_BUTTON_COLOR_DOWNG2, KB_BUTTON_COLOR_DOWNB2};
    unsigned char r     = 0;
    unsigned char g     = 0;
    unsigned char b     = 0;
    unsigned int color  = 0;
Exemple #2
0
#include "../common/message.h"
#include "gui.h"

extern Adafruit_ILI9341 tft;
extern Pipeline *pipe;
TouchScreen screen = TouchScreen(XP, YP, XM, YM);

void Pipeline::segueTo(ViewController *nextController) {
    flush();
    if (_previousController != nullptr) {
        delete _previousController;
        _previousController = nullptr;
    }
    if (_viewController != nullptr) {
        _viewController->deinit();
        delete _viewController;
    }
    _viewController = nextController;
    _viewController->init();
}

void Pipeline::seguePopover(ViewController *popoverController) {
    flush();
    if (_previousController == nullptr) {
        _previousController = _viewController;
        _previousController->deinit();
    }
    _viewController = popoverController;
    _viewController->init();
}
Exemple #3
0
#include <Adafruit_MotorShield.h>
#include "Stage.h"
#include "TouchScreen.h"

// Create the motor shield objects
Adafruit_MotorShield lower_afms = Adafruit_MotorShield(0x60);
Adafruit_MotorShield upper_afms = Adafruit_MotorShield(0x61);

// Create stepper motors for each axis (200 steps per rev)
Adafruit_StepperMotor *xy_a_motor = lower_afms.getStepper(200,1);
Adafruit_StepperMotor *xy_b_motor = lower_afms.getStepper(200,2);
Adafruit_StepperMotor *z_1_motor = upper_afms.getStepper(200, 1);
Adafruit_StepperMotor *z_2_motor = upper_afms.getStepper(200, 2);

//Create the touchscreen object
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

Stage::Stage() {
  //Initialize AccelStepper object with wrapper functions and parameters.
  calibrated = false;

}

void Stage::begin()
{
  //Initiliaze the motor shield
  lower_afms.begin();
  upper_afms.begin();

  //Setup pins for input
  pinMode(Z_ULIMIT_SWITCH, INPUT_PULLUP);