/* #define LEFT 0 #define RIGHT 9999 #define CENTER 9998 //??? #define PORTRAIT 0 #define LANDSCAPE 1 //********************************* // COLORS //********************************* // VGA color palette #define VGA_BLACK 0x0000 #define VGA_WHITE 0xFFFF #define VGA_RED 0xF800 #define VGA_GREEN 0x0400 #define VGA_BLUE 0x001F #define VGA_SILVER 0xC618 #define VGA_GRAY 0x8410 #define VGA_MAROON 0x8000 #define VGA_YELLOW 0xFFE0 #define VGA_OLIVE 0x8400 #define VGA_LIME 0x07E0 #define VGA_AQUA 0x07FF #define VGA_TEAL 0x0410 #define VGA_NAVY 0x0010 #define VGA_FUCHSIA 0xF81F #define VGA_PURPLE 0x8010 #define VGA_TRANSPARENT 0xFFFFFFFF #if defined(__AVR__) #include "Arduino.h" #include "hardware/avr/HW_AVR_defines.h" #elif defined(__PIC32MX__) #include "WProgram.h" #include "hardware/pic32/HW_PIC32_defines.h" #elif defined(__arm__) #include "Arduino.h" #include "hardware/arm/HW_ARM_defines.h" #endif struct _current_font { uint8_t* font; uint8_t x_size; uint8_t y_size; uint8_t offset; uint8_t numchars; }; class UTFT { public: UTFT(); UTFT(byte model, int RS, int WR, int CS, int RST, int SER=0); void InitLCD(byte orientation=LANDSCAPE); void clrScr(); void drawPixel(int x, int y); void drawLine(int x1, int y1, int x2, int y2); void fillScr(byte r, byte g, byte b); void fillScr(word color); void drawRect(int x1, int y1, int x2, int y2); void drawRoundRect(int x1, int y1, int x2, int y2); void fillRect(int x1, int y1, int x2, int y2); void fillRoundRect(int x1, int y1, int x2, int y2); void drawCircle(int x, int y, int radius); void fillCircle(int x, int y, int radius); void setColor(byte r, byte g, byte b); void setColor(word color); word getColor(); void setBackColor(byte r, byte g, byte b); void setBackColor(uint32_t color); word getBackColor(); void print(char *st, int x, int y, int deg=0); void print(String st, int x, int y, int deg=0); void printNumI(long num, int x, int y, int length=0, char filler=' '); void printNumF(double num, byte dec, int x, int y, char divider='.', int length=0, char filler=' '); void setFont(uint8_t* font); uint8_t* getFont(); uint8_t getFontXsize(); uint8_t getFontYsize(); void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int scale=1); void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int deg, int rox, int roy); void lcdOff(); void lcdOn(); void setContrast(char c); int getDisplayXSize(); int getDisplayYSize(); void setBrightness(byte br); void setDisplayPage(byte page); void setWritePage(byte page); */ #include #include UTFT myGLCD(HX8357C, 38, 39, 40, 41); UTFT_Geometry geo(&myGLCD); void setup() { myGLCD.InitLCD(); myGLCD.clrScr(); int r = 150; } //int y = x+=2; void loop() { int r = 150; myGLCD.fillScr(100,100,100); myGLCD.setColor(255, 0, 0); geo.drawArc(200, 180, r, -90, 90, 12); myGLCD.setColor(255, 150, 0); geo.drawArc(200, 180,r-=15 , -90, 90, 12); myGLCD.setColor(255, 255, 0); geo.drawArc(200, 180, r-=15,-90,90,12); myGLCD.setColor(0, 255, 0); geo.drawArc(200, 180, r-=15,-90,90,12); myGLCD.setColor(0,0,255); geo.drawArc(200, 180, r-=15,-90,90,12); myGLCD.setColor(200,0,255); geo.drawArc(200, 180, r-=15 ,-90,90,12); myGLCD.setColor(VGA_AQUA); while(true); }