Interfaçage NeoPixel Ring 12, LPRO MECSE, Arnaud A.
Diff: view2.h
- Revision:
- 0:c95a8c8c3c9b
- Child:
- 1:2a58d8fcf7f9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/view2.h Wed Jun 17 16:34:16 2020 +0000 @@ -0,0 +1,56 @@ +#ifndef VIEW2_H +#define VIEW2_H +#include "mbed.h" +#include "button.h" +#include "stm32746g_discovery_lcd.h" +#include "stm32746g_discovery_ts.h" +#include <list> +#include <stdlib.h> +#define SCREENWIDTH 480 +#define SCREENHEIGHT 272 +#define LED_BUTTON_SIZE 40 +#define RGB_TEXT_VIEW_WIDTH 30 +#define RGB_TEXT_VIEW_HEIGHT 15 +#define PLUS_MINUS_BUTTON_SIZE 30 +#define ANIMATION_BUTTON_WIDTH 80 +#define ANIMATION_BUTTON_HEIGHT 15 +#define LIGHT_GRAY (uint32_t)0xFFe0e0d1 + + +class View2 +{ +public: + View2(int width = SCREENWIDTH, int height = SCREENHEIGHT); + void contain(int x, int y); + void draw(); + void updateLCD(); + void initView(); + ~View2(); + + +private : + void drawText(); + int16_t m_width = SCREENWIDTH; + int16_t m_height = SCREENHEIGHT; + uint32_t m_bgColor = LCD_COLOR_WHITE; + list<Button *> m_buttonList; + TS_StateTypeDef TS_State; + uint16_t x, y; + uint8_t idx; + bool screenReleased=false; + bool cleared = false; + uint8_t RGB[3]={0x00, 0x00, 0x00}; + char str[10]; + bool ledSelected[12]={false, false, false, false, + false, false, false, false, + false, false, false, false}; + //Animations + Button *anim1 = new Button(20, 38, ANIMATION_BUTTON_WIDTH, ANIMATION_BUTTON_HEIGHT, LIGHT_GRAY); + Button *anim2 = new Button(20, 68, ANIMATION_BUTTON_WIDTH, ANIMATION_BUTTON_HEIGHT, LIGHT_GRAY); + Button *anim3 = new Button(20, 98, ANIMATION_BUTTON_WIDTH, ANIMATION_BUTTON_HEIGHT, LIGHT_GRAY); + Button *start = new Button(20, 128, 120, ANIMATION_BUTTON_HEIGHT+5, LIGHT_GRAY); + Button *stop = new Button(20, 163, 120, ANIMATION_BUTTON_HEIGHT+5, LIGHT_GRAY); + +}; + +#endif