54 switch (triggeredAction) {
61 int16_t deltaX = p.
x - old_pos.
x;
62 int16_t deltaY = p.
y - old_pos.
y;
68 int16_t new_x = pixy_pos.
x + deltaX * 2;
69 int16_t new_y = pixy_pos.
y - deltaY * 2;
121 b_back.
text =
"Back";
133 b_save.
text =
"Save it!";
153 pixy_pos.
x = pixy_pos.
y = 500;
179 pixy_pos.
x = pixy_pos.
y = 500;
182 printf(
"pixy (re)initialized\n");
bool touch_register_area(TOUCH_AREA_STRUCT *area)
const char * text
The label of the button.
Receive an event when the pen moves inside the region (pen is down)
uint16_t txtcolor
The 16-bit text color.
Receive an event when the pen goes down inside the region.
Receive an event when the pen goes up inside the region.
SCREEN_STRUCT * get_screen_photomodesave()
uint16_t y1
Top Left Y-Coordinate of Area.
uint16_t y
The Y-Coordinate of the point.
static void touchCB(void *touchArea, TOUCH_ACTION triggeredAction)
void tft_print_line(uint16_t x, uint16_t y, uint16_t color, uint16_t bgcolor, uint8_t font, const char *text)
uint16_t x
The X-Coordinate of the point.
uint16_t x1
Top Left X-Coordinate of Area.
static BUTTON_STRUCT b_back
uint16_t bgcolor
The 16-bit background color of the button.
static POINT_STRUCT pixy_pos
TOUCH_AREA_STRUCT base
Basic geometry of the button. You only need to set the x1, y1, x2, y2 members of this struct...
static SCREEN_STRUCT screen
void touch_unregister_area(TOUCH_AREA_STRUCT *area)
static void b_save_cb(void *button)
uint16_t y2
Bottom Right Y-Coordinate of Area.
static void leave(void *screen)
static BUTTON_STRUCT b_save
TOUCH_CALLBACK callback
Callback which is executed when an event occurred in this Area.
void tft_clear(uint16_t color)
static void b_back_cb(void *button)
uint16_t x2
Bottom Right X-Coordinate of Area.
static TOUCH_AREA_STRUCT a_area
Receive an event when the pen enters the region (pen was down before)
bool gui_screen_navigate(SCREEN_STRUCT *screen)
static void enter(void *screen)
SCREEN_STRUCT * get_screen_photomode()
POINT_STRUCT touch_get_last_point()
static POINT_STRUCT old_pos
int pixy_init()
Creates a connection with Pixy and listens for Pixy messages.
TOUCH_ACTION hookedActions
Actions to listen to.
static bool pixy_connected
int pixy_rcs_set_position(uint8_t channel, uint16_t position)
Set pixy servo axis position.
static void update(void *screen)
void pixy_close()
Terminates connection with Pixy.
BUTTON_CALLBACK callback
Callback which is executed when the button is pressed.
int pixy_render_full_frame(uint16_t x, uint16_t y)
uint8_t font
The number of the font to use.
Receive an event when the pen leaves the region (pen was inside region before)