Fix search and replace errors

This commit is contained in:
Bodmer
2023-12-19 02:18:01 +00:00
parent 9ab133f810
commit 2d88fe4c6e
28 changed files with 64 additions and 64 deletions

View File

@ -76,7 +76,7 @@ void setup()
tft.setSwapBytes(true); tft.setSwapBytes(true);
// The decoder must be given the exact name of the rendering function above // The decoder must be given the exact name of the rendering function above
TJpgDec.setcallback(tft_output); TJpgDec.setCallback(tft_output);
} }
void loop() void loop()

View File

@ -147,8 +147,8 @@ void setup() {
ypos = (tft.height() - IHEIGHT) / 2; ypos = (tft.height() - IHEIGHT) / 2;
// Define cprite colour depth // Define cprite colour depth
spr[0].setcolorDepth(COLOR_DEPTH); spr[0].setColorDepth(COLOR_DEPTH);
spr[1].setcolorDepth(COLOR_DEPTH); spr[1].setColorDepth(COLOR_DEPTH);
// Create the 2 sprites // Create the 2 sprites
sprPtr[0] = (uint16_t*)spr[0].createSprite(IWIDTH, IHEIGHT); sprPtr[0] = (uint16_t*)spr[0].createSprite(IWIDTH, IHEIGHT);

View File

@ -50,7 +50,7 @@ void setup(void) {
tft.setRotation(1); tft.setRotation(1);
spr.setcolorDepth(16); // 16-bit colour needed to show antialiased fonts spr.setColorDepth(16); // 16-bit colour needed to show antialiased fonts
} }
void loop() { void loop() {
@ -182,7 +182,7 @@ void button(int x, int y, int num )
#define IHEIGHT 25 #define IHEIGHT 25
// Create a 16-bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed) // Create a 16-bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed)
spr.setcolorDepth(16); spr.setColorDepth(16);
spr.createSprite(IWIDTH, IHEIGHT); spr.createSprite(IWIDTH, IHEIGHT);
// Fill it with black (this will be the transparent colour this time) // Fill it with black (this will be the transparent colour this time)

View File

@ -58,7 +58,7 @@ void setup(void) {
tft.setRotation(1); tft.setRotation(1);
spr.setcolorDepth(16); // 16-bit colour needed to show anti-aliased fonts spr.setColorDepth(16); // 16-bit colour needed to show anti-aliased fonts
} }
void loop() { void loop() {

View File

@ -11,7 +11,7 @@
will return the pixel color at a position x,y on the TFT. In this sketch that will return the pixel color at a position x,y on the TFT. In this sketch that
function is called gradientColor, so this line is included in setup(): function is called gradientColor, so this line is included in setup():
tft.setcallback(gradientColor); tft.setCallback(gradientColor);
TFT_eSPI will call this function during the rendering of the anti-aliased TFT_eSPI will call this function during the rendering of the anti-aliased
font to blend the edges of each character with the returned color. font to blend the edges of each character with the returned color.
@ -66,8 +66,8 @@ void setup(void) {
tft.begin(); tft.begin();
tft.setcallback(gradientColor); // Switch on color callback for anti-aliased fonts tft.setCallback(gradientColor); // Switch on color callback for anti-aliased fonts
//tft.setcallback(nullptr); // Switch off callback (off by default) //tft.setCallback(nullptr); // Switch off callback (off by default)
tft.setRotation(1); tft.setRotation(1);
} }

View File

@ -9,7 +9,7 @@
that will return the pixel color at a position x,y on the TFT. In this that will return the pixel color at a position x,y on the TFT. In this
sketch that function is called pixelColor, so this line is included: sketch that function is called pixelColor, so this line is included:
tft.setcallback(pixelColor); tft.setCallback(pixelColor);
TFT_eSPI will call this function during the rendering of the anti-aliased TFT_eSPI will call this function during the rendering of the anti-aliased
font and use it to blend the edges of each character with the screen color. font and use it to blend the edges of each character with the screen color.
@ -43,8 +43,8 @@ void setup(void) {
tft.begin(); tft.begin();
tft.setcallback(pixelColor); // Switch on color callback for anti-aliased fonts tft.setCallback(pixelColor); // Switch on color callback for anti-aliased fonts
//tft.setcallback(nullptr); // Switch off callback (off by default) //tft.setCallback(nullptr); // Switch off callback (off by default)
tft.setRotation(1); tft.setRotation(1);
} }

View File

@ -51,7 +51,7 @@ void setup(void) {
tft.setRotation(1); tft.setRotation(1);
spr.setcolorDepth(16); // 16-bit colour needed to show antialiased fonts spr.setColorDepth(16); // 16-bit colour needed to show antialiased fonts
if (!LittleFS.begin()) { if (!LittleFS.begin()) {
Serial.println("Flash FS initialisation failed!"); Serial.println("Flash FS initialisation failed!");
@ -201,7 +201,7 @@ void button(int x, int y, int num )
#define IHEIGHT 25 #define IHEIGHT 25
// Create a 16-bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed) // Create a 16-bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed)
spr.setcolorDepth(16); spr.setColorDepth(16);
spr.createSprite(IWIDTH, IHEIGHT); spr.createSprite(IWIDTH, IHEIGHT);
// Fill it with black (this will be the transparent colour this time) // Fill it with black (this will be the transparent colour this time)

View File

@ -61,7 +61,7 @@ void setup(void) {
tft.setRotation(1); tft.setRotation(1);
spr.setcolorDepth(16); // 16-bit colour needed to show anti-aliased fonts spr.setColorDepth(16); // 16-bit colour needed to show anti-aliased fonts
if (!LittleFS.begin()) { if (!LittleFS.begin()) {
Serial.println("Flash FS initialisation failed!"); Serial.println("Flash FS initialisation failed!");

View File

@ -10,7 +10,7 @@
that will return the pixel xolor at a position x,y on the TFT. In this that will return the pixel xolor at a position x,y on the TFT. In this
sketch that function is called gradientColor, so this line is included: sketch that function is called gradientColor, so this line is included:
tft.setcallback(gradientColor); tft.setCallback(gradientColor);
TFT_eSPI will call this function during the rendering of the anti-aliased TFT_eSPI will call this function during the rendering of the anti-aliased
font to blend the edges of each character with the returned color. font to blend the edges of each character with the returned color.
@ -73,8 +73,8 @@ void setup(void) {
tft.begin(); tft.begin();
tft.setcallback(gradientColor); // Switch on color callback for anti-aliased fonts tft.setCallback(gradientColor); // Switch on color callback for anti-aliased fonts
//tft.setcallback(nullptr); // Switch off callback (off by default) //tft.setCallback(nullptr); // Switch off callback (off by default)
tft.setRotation(1); tft.setRotation(1);

View File

@ -10,7 +10,7 @@
that will return the pixel color at a position x,y on the TFT. In this that will return the pixel color at a position x,y on the TFT. In this
sketch that function is called pixelColor, so this line is included: sketch that function is called pixelColor, so this line is included:
tft.setcallback(pixelColor); tft.setCallback(pixelColor);
TFT_eSPI will call this function during the rendering of the anti-aliased TFT_eSPI will call this function during the rendering of the anti-aliased
font and use it to blend the edges of each character with the screen color. font and use it to blend the edges of each character with the screen color.
@ -52,8 +52,8 @@ void setup(void) {
tft.begin(); tft.begin();
tft.setcallback(pixelColor); // The callback is only used during font rendering tft.setCallback(pixelColor); // The callback is only used during font rendering
//tft.setcallback(nullptr); // Switch off callback (off by default) //tft.setCallback(nullptr); // Switch off callback (off by default)
tft.setRotation(1); tft.setRotation(1);

View File

@ -50,7 +50,7 @@ void setup(void) {
tft.setRotation(1); tft.setRotation(1);
spr.setcolorDepth(16); // 16-bit colour needed to show anti aliased fonts spr.setColorDepth(16); // 16-bit colour needed to show anti aliased fonts
if (!SPIFFS.begin()) { if (!SPIFFS.begin()) {
Serial.println("SPIFFS initialisation failed!"); Serial.println("SPIFFS initialisation failed!");
@ -201,7 +201,7 @@ void button(int x, int y, int num )
#define IHEIGHT 25 #define IHEIGHT 25
// Create a 16-bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed) // Create a 16-bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed)
spr.setcolorDepth(16); spr.setColorDepth(16);
spr.createSprite(IWIDTH, IHEIGHT); spr.createSprite(IWIDTH, IHEIGHT);
// Fill it with black (this will be the transparent colour this time) // Fill it with black (this will be the transparent colour this time)

View File

@ -61,7 +61,7 @@ void setup(void) {
tft.setRotation(1); tft.setRotation(1);
spr.setcolorDepth(16); // 16-bit colour needed to show anti-aliased fonts spr.setColorDepth(16); // 16-bit colour needed to show anti-aliased fonts
if (!SPIFFS.begin()) { if (!SPIFFS.begin()) {
Serial.println("SPIFFS initialisation failed!"); Serial.println("SPIFFS initialisation failed!");

View File

@ -10,7 +10,7 @@
that will return the pixel color at a position x,y on the TFT. In this that will return the pixel color at a position x,y on the TFT. In this
sketch that function is called gradientColor, so this line is included: sketch that function is called gradientColor, so this line is included:
tft.setcallback(gradientColor); tft.setCallback(gradientColor);
TFT_eSPI will call this function during the rendering of the anti-aliased TFT_eSPI will call this function during the rendering of the anti-aliased
font to blend the edges of each character with the returned color. font to blend the edges of each character with the returned color.
@ -73,8 +73,8 @@ void setup(void) {
tft.begin(); tft.begin();
tft.setcallback(gradientColor); // Switch on color callback for anti-aliased fonts tft.setCallback(gradientColor); // Switch on color callback for anti-aliased fonts
//tft.setcallback(nullptr); // Switch off callback (off by default) //tft.setCallback(nullptr); // Switch off callback (off by default)
tft.setRotation(1); tft.setRotation(1);

View File

@ -10,7 +10,7 @@
that will return the pixel color at a position x,y on the TFT. In this that will return the pixel color at a position x,y on the TFT. In this
sketch that function is called pixelColor, so this line is included: sketch that function is called pixelColor, so this line is included:
tft.setcallback(pixelColor); tft.setCallback(pixelColor);
TFT_eSPI will call this function during the rendering of the anti-aliased TFT_eSPI will call this function during the rendering of the anti-aliased
font and use it to blend the edges of each character with the screen color. font and use it to blend the edges of each character with the screen color.
@ -52,8 +52,8 @@ void setup(void) {
tft.begin(); tft.begin();
tft.setcallback(pixelColor); // The callback is only used during font rendering tft.setCallback(pixelColor); // The callback is only used during font rendering
//tft.setcallback(nullptr); // Switch off callback (off by default) //tft.setCallback(nullptr); // Switch off callback (off by default)
tft.setRotation(1); tft.setRotation(1);

View File

@ -74,7 +74,7 @@ void setup() {
tft.fillScreen(TFT_BLACK); tft.fillScreen(TFT_BLACK);
// Create the clock face sprite // Create the clock face sprite
//face.setcolorDepth(8); // 8-bit will work, but reduces effectiveness of anti-aliasing //face.setColorDepth(8); // 8-bit will work, but reduces effectiveness of anti-aliasing
face.createSprite(FACE_W, FACE_H); face.createSprite(FACE_W, FACE_H);
// Only 1 font used in the sprite, so can remain loaded // Only 1 font used in the sprite, so can remain loaded
@ -138,7 +138,7 @@ static void renderFace(float t) {
// Draw digits around clock perimeter // Draw digits around clock perimeter
for (uint32_t h = 1; h <= 12; h++) { for (uint32_t h = 1; h <= 12; h++) {
getcoord(CLOCK_R, CLOCK_R, &xp, &yp, dialOffset, h * 360.0 / 12); getCoord(CLOCK_R, CLOCK_R, &xp, &yp, dialOffset, h * 360.0 / 12);
face.drawNumber(h, xp, 2 + yp); face.drawNumber(h, xp, 2 + yp);
} }
@ -147,12 +147,12 @@ static void renderFace(float t) {
face.drawString("TFT_eSPI", CLOCK_R, CLOCK_R * 0.75); face.drawString("TFT_eSPI", CLOCK_R, CLOCK_R * 0.75);
// Draw minute hand // Draw minute hand
getcoord(CLOCK_R, CLOCK_R, &xp, &yp, M_HAND_LENGTH, m_angle); getCoord(CLOCK_R, CLOCK_R, &xp, &yp, M_HAND_LENGTH, m_angle);
face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 6.0f, CLOCK_FG); face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 6.0f, CLOCK_FG);
face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 2.0f, CLOCK_BG); face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 2.0f, CLOCK_BG);
// Draw hour hand // Draw hour hand
getcoord(CLOCK_R, CLOCK_R, &xp, &yp, H_HAND_LENGTH, h_angle); getCoord(CLOCK_R, CLOCK_R, &xp, &yp, H_HAND_LENGTH, h_angle);
face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 6.0f, CLOCK_FG); face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 6.0f, CLOCK_FG);
face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 2.0f, CLOCK_BG); face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 2.0f, CLOCK_BG);
@ -160,7 +160,7 @@ static void renderFace(float t) {
face.fillSmoothCircle(CLOCK_R, CLOCK_R, 4, CLOCK_FG); face.fillSmoothCircle(CLOCK_R, CLOCK_R, 4, CLOCK_FG);
// Draw cecond hand // Draw cecond hand
getcoord(CLOCK_R, CLOCK_R, &xp, &yp, S_HAND_LENGTH, s_angle); getCoord(CLOCK_R, CLOCK_R, &xp, &yp, S_HAND_LENGTH, s_angle);
face.drawWedgeLine(CLOCK_R, CLOCK_R, xp, yp, 2.5, 1.0, SECCOND_FG); face.drawWedgeLine(CLOCK_R, CLOCK_R, xp, yp, 2.5, 1.0, SECCOND_FG);
face.pushSprite(5, 5, TFT_TRANSPARENT); face.pushSprite(5, 5, TFT_TRANSPARENT);
} }
@ -170,7 +170,7 @@ static void renderFace(float t) {
// ========================================================================= // =========================================================================
// Coordinates are returned to caller via the xp and yp pointers // Coordinates are returned to caller via the xp and yp pointers
#define DEG2RAD 0.0174532925 #define DEG2RAD 0.0174532925
void getcoord(int16_t x, int16_t y, float *xp, float *yp, int16_t r, float a) void getCoord(int16_t x, int16_t y, float *xp, float *yp, int16_t r, float a)
{ {
float sx1 = cos( (a - 90) * DEG2RAD); float sx1 = cos( (a - 90) * DEG2RAD);
float sy1 = sin( (a - 90) * DEG2RAD); float sy1 = sin( (a - 90) * DEG2RAD);

View File

@ -63,7 +63,7 @@ void loop() {
int w1 = r1 / 25; int w1 = r1 / 25;
int w2 = r2 / 20; int w2 = r2 / 20;
// The following will be updated by the getcoord function // The following will be updated by the getCoord function
float px1 = 0.0; float px1 = 0.0;
float py1 = 0.0; float py1 = 0.0;
float px2 = 0.0; float px2 = 0.0;
@ -72,7 +72,7 @@ void loop() {
// Wedge line function, an anti-aliased wide line between 2 points, with different // Wedge line function, an anti-aliased wide line between 2 points, with different
// line widths at the two ends. Background colour is black. // line widths at the two ends. Background colour is black.
for (int angle = -130; angle <= 130; angle += 10) { for (int angle = -130; angle <= 130; angle += 10) {
getcoord(cx, cy, &px1, &py1, &px2, &py2, r1, r2, angle); getCoord(cx, cy, &px1, &py1, &px2, &py2, r1, r2, angle);
uint16_t colour = rainbow(map(angle, -130, 130, 0, 127)); uint16_t colour = rainbow(map(angle, -130, 130, 0, 127));
if (angle > 45) colour = TFT_DARKGREY; if (angle > 45) colour = TFT_DARKGREY;
tft.drawWedgeLine(px1, py1, px2, py2, w1, w2, colour, TFT_BLACK); tft.drawWedgeLine(px1, py1, px2, py2, w1, w2, colour, TFT_BLACK);
@ -82,7 +82,7 @@ void loop() {
tft.fillSmoothCircle(cx, cy, r1 - 8, TFT_MAROON, TFT_BLACK); tft.fillSmoothCircle(cx, cy, r1 - 8, TFT_MAROON, TFT_BLACK);
// Draw a white dial pointer using wedge line function // Draw a white dial pointer using wedge line function
getcoord(cx, cy, &px1, &py1, &px2, &py2, 0, r1 - 10, 45); getCoord(cx, cy, &px1, &py1, &px2, &py2, 0, r1 - 10, 45);
// Magenta wedge line pointer on red background // Magenta wedge line pointer on red background
// Line tapers from radius 5 to zero // Line tapers from radius 5 to zero
tft.drawWedgeLine(cx, cy, px2, py2, 5, 0, TFT_WHITE, TFT_MAROON); tft.drawWedgeLine(cx, cy, px2, py2, 5, 0, TFT_WHITE, TFT_MAROON);
@ -133,7 +133,7 @@ void loop() {
// ========================================================================= // =========================================================================
// Coordinates are returned to caller via the xp and yp pointers // Coordinates are returned to caller via the xp and yp pointers
#define DEG2RAD 0.0174532925 #define DEG2RAD 0.0174532925
void getcoord(int16_t x, int16_t y, float *xp1, float *yp1, float *xp2, float *yp2, int16_t r1, int16_t r2, float a) void getCoord(int16_t x, int16_t y, float *xp1, float *yp1, float *xp2, float *yp2, int16_t r1, int16_t r2, float a)
{ {
float sx = cos( (a - 90) * DEG2RAD); float sx = cos( (a - 90) * DEG2RAD);
float sy = sin( (a - 90) * DEG2RAD); float sy = sin( (a - 90) * DEG2RAD);

View File

@ -70,7 +70,7 @@ void setup() {
TJpgDec.setSwapBytes(true); TJpgDec.setSwapBytes(true);
// The jpeg decoder must be given the exact name of the rendering function above // The jpeg decoder must be given the exact name of the rendering function above
TJpgDec.setcallback(tft_output); TJpgDec.setCallback(tft_output);
tft.begin(); tft.begin();
tft.setRotation(0); tft.setRotation(0);
@ -128,7 +128,7 @@ void loop() {
// ======================================================================================= // =======================================================================================
void createNeedle(void) void createNeedle(void)
{ {
needle.setcolorDepth(16); needle.setColorDepth(16);
needle.createSprite(NEEDLE_WIDTH, NEEDLE_LENGTH); // create the needle Sprite needle.createSprite(NEEDLE_WIDTH, NEEDLE_LENGTH); // create the needle Sprite
needle.fillSprite(TFT_BLACK); // Fill with black needle.fillSprite(TFT_BLACK); // Fill with black

View File

@ -76,7 +76,7 @@ void drawStar(int x, int y, int star_color)
// Create an 1 bit (2 colour) sprite 70x80 pixels (uses 70*80/8 = 700 bytes of RAM) // Create an 1 bit (2 colour) sprite 70x80 pixels (uses 70*80/8 = 700 bytes of RAM)
// Colour depths of 8 bits per pixel and 16 bits are also supported. // Colour depths of 8 bits per pixel and 16 bits are also supported.
img.setcolorDepth(BITS_PER_PIXEL); // Set colour depth first img.setColorDepth(BITS_PER_PIXEL); // Set colour depth first
img.createSprite(70, 80); // then create the sprite img.createSprite(70, 80); // then create the sprite
// Fill Sprite with the colour that will be defined later as "transparent" // Fill Sprite with the colour that will be defined later as "transparent"

View File

@ -34,7 +34,7 @@ void setup(void)
tft.setRotation(0); tft.setRotation(0);
tft.fillScreen(TFT_BLUE); tft.fillScreen(TFT_BLUE);
img.setcolorDepth(COLOR_DEPTH); img.setColorDepth(COLOR_DEPTH);
img.createSprite(RADIUS*2+1, RADIUS*2+1); img.createSprite(RADIUS*2+1, RADIUS*2+1);
img.fillSprite(TFT_BLACK); img.fillSprite(TFT_BLACK);
} }
@ -68,14 +68,14 @@ void loop() {
void yinyang(int x, int y, int start_angle, int r) void yinyang(int x, int y, int start_angle, int r)
{ {
int x1 = 0; // getcoord() will update these int x1 = 0; // getCoord() will update these
int y1 = 0; int y1 = 0;
getcoord(x, y, &x1, &y1, r/2, start_angle); // Get x1 ,y1 getCoord(x, y, &x1, &y1, r/2, start_angle); // Get x1 ,y1
img.fillCircle( x1, y1, r/2, TFT_WHITE); img.fillCircle( x1, y1, r/2, TFT_WHITE);
img.fillCircle( x1, y1, r/8, TFT_BLACK); img.fillCircle( x1, y1, r/8, TFT_BLACK);
getcoord(x, y, &x1, &y1, r/2, start_angle + 180); getCoord(x, y, &x1, &y1, r/2, start_angle + 180);
img.fillCircle( x1, y1, r/2, TFT_BLACK); img.fillCircle( x1, y1, r/2, TFT_BLACK);
img.fillCircle( x1, y1, r/8, TFT_WHITE); img.fillCircle( x1, y1, r/8, TFT_WHITE);
@ -87,7 +87,7 @@ void yinyang(int x, int y, int start_angle, int r)
// ========================================================================= // =========================================================================
// Coordinates are returned to caller via the xp and yp pointers // Coordinates are returned to caller via the xp and yp pointers
#define RAD2DEG 0.0174532925 #define RAD2DEG 0.0174532925
void getcoord(int x, int y, int *xp, int *yp, int r, int a) void getCoord(int x, int y, int *xp, int *yp, int r, int a)
{ {
float sx1 = cos( (a-90) * RAD2DEG ); float sx1 = cos( (a-90) * RAD2DEG );
float sy1 = sin( (a-90) * RAD2DEG ); float sy1 = sin( (a-90) * RAD2DEG );

View File

@ -90,7 +90,7 @@ void loop() {
// ========================================================================= // =========================================================================
// Coordinates are returned to caller via the xp and yp pointers // Coordinates are returned to caller via the xp and yp pointers
#define DEG2RAD 0.0174532925 #define DEG2RAD 0.0174532925
void getcoord(int x, int y, int *xp, int *yp, int r, float a) void getCoord(int x, int y, int *xp, int *yp, int r, float a)
{ {
float sx1 = cos( -a * DEG2RAD ); float sx1 = cos( -a * DEG2RAD );
float sy1 = sin( -a * DEG2RAD ); float sy1 = sin( -a * DEG2RAD );
@ -131,10 +131,10 @@ int plot_planets(void)
{ {
ang = Astronomy_EclipticLongitude(body[i], astro_time); ang = Astronomy_EclipticLongitude(body[i], astro_time);
int x1 = 0; // getcoord() will update these int x1 = 0; // getCoord() will update these
int y1 = 0; int y1 = 0;
getcoord(0, 0, &x1, &y1, i * 28, ang.angle); // Get x1 ,y1 getCoord(0, 0, &x1, &y1, i * 28, ang.angle); // Get x1 ,y1
img.fillSprite(TFT_TRANSPARENT); img.fillSprite(TFT_TRANSPARENT);
img.fillCircle(9, 9, 9, TFT_BLACK); img.fillCircle(9, 9, 9, TFT_BLACK);
@ -149,7 +149,7 @@ int plot_planets(void)
int xm = 0; int xm = 0;
int ym = 0; int ym = 0;
getcoord(x1, y1, &xm, &ym, 15, 180 + ang.angle + mang.angle); // Get x1 ,y1 getCoord(x1, y1, &xm, &ym, 15, 180 + ang.angle + mang.angle); // Get x1 ,y1
img.fillSprite(TFT_TRANSPARENT); img.fillSprite(TFT_TRANSPARENT);
img.fillCircle(9, 9, 7, TFT_BLACK); img.fillCircle(9, 9, 7, TFT_BLACK);

View File

@ -59,7 +59,7 @@ void loop() {
drawX(xw, yh); // Show where screen pivot is drawX(xw, yh); // Show where screen pivot is
// Create the Sprite // Create the Sprite
spr.setcolorDepth(8); // Create an 8bpp Sprite of 60x30 pixels spr.setColorDepth(8); // Create an 8bpp Sprite of 60x30 pixels
spr.createSprite(64, 30); // 8bpp requires 64 * 30 = 1920 bytes spr.createSprite(64, 30); // 8bpp requires 64 * 30 = 1920 bytes
spr.setPivot(32, 55); // Set pivot relative to top left corner of Sprite spr.setPivot(32, 55); // Set pivot relative to top left corner of Sprite
spr.fillSprite(TFT_BLACK); // Fill the Sprite with black spr.fillSprite(TFT_BLACK); // Fill the Sprite with black
@ -120,7 +120,7 @@ void loop() {
spr.deleteSprite(); spr.deleteSprite();
spr.setcolorDepth(8); // Create a 8bpp Sprite spr.setColorDepth(8); // Create a 8bpp Sprite
spr.createSprite(40, 30); // Create a new Sprite 40x30 spr.createSprite(40, 30); // Create a new Sprite 40x30
spr.setPivot(20, 70); // Set Sprite pivot at 20,80 spr.setPivot(20, 70); // Set Sprite pivot at 20,80

View File

@ -99,7 +99,7 @@ void loop() {
void createDialScale(int16_t start_angle, int16_t end_angle, int16_t increment) void createDialScale(int16_t start_angle, int16_t end_angle, int16_t increment)
{ {
// Create the dial Sprite // Create the dial Sprite
dial.setcolorDepth(8); // Size is odd (i.e. 91) so there is a centre pixel at 45,45 dial.setColorDepth(8); // Size is odd (i.e. 91) so there is a centre pixel at 45,45
dial.createSprite(91, 91); // 8bpp requires 91 * 91 = 8281 bytes dial.createSprite(91, 91); // 8bpp requires 91 * 91 = 8281 bytes
dial.setPivot(45, 45); // set pivot in middle of dial Sprite dial.setPivot(45, 45); // set pivot in middle of dial Sprite
@ -158,7 +158,7 @@ void plotDial(int16_t x, int16_t y, int16_t angle, String label, uint16_t val)
void createNeedle(void) void createNeedle(void)
{ {
needle.setcolorDepth(8); needle.setColorDepth(8);
needle.createSprite(11, 49); // create the needle Sprite 11 pixels wide by 49 high needle.createSprite(11, 49); // create the needle Sprite 11 pixels wide by 49 high
needle.fillSprite(TFT_BLACK); // Fill with black needle.fillSprite(TFT_BLACK); // Fill with black

View File

@ -31,7 +31,7 @@ void setup(void) {
tft.fillScreen(TFT_BLUE); tft.fillScreen(TFT_BLUE);
//img.setcolorDepth(8); // Optionally set depth to 8 to halve RAM use //img.setColorDepth(8); // Optionally set depth to 8 to halve RAM use
img.createSprite(IWIDTH, IHEIGHT); img.createSprite(IWIDTH, IHEIGHT);
img.fillSprite(TFT_BLACK); img.fillSprite(TFT_BLACK);
} }

View File

@ -47,7 +47,7 @@ void setup()
tft.init(); tft.init();
// Optionally set colour depth to 8 or 16 bits, default is 16 if not specified // Optionally set colour depth to 8 or 16 bits, default is 16 if not specified
// spr.setcolorDepth(8); // spr.setColorDepth(8);
// Create a sprite of defined size // Create a sprite of defined size
spr.createSprite(WIDTH, HEIGHT); spr.createSprite(WIDTH, HEIGHT);

View File

@ -50,7 +50,7 @@ void setup()
tft.init(); tft.init();
// Set the sprite colour depth to 4 // Set the sprite colour depth to 4
spr.setcolorDepth(4); spr.setColorDepth(4);
// Create a sprite of defined size // Create a sprite of defined size
spr.createSprite(WIDTH, HEIGHT); spr.createSprite(WIDTH, HEIGHT);

View File

@ -59,7 +59,7 @@ void setup()
// Initialise the TFT registers // Initialise the TFT registers
tft.init(); tft.init();
spr.setcolorDepth(4); spr.setColorDepth(4);
// Create a sprite of defined size // Create a sprite of defined size
spr.createSprite(WIDTH, HEIGHT); spr.createSprite(WIDTH, HEIGHT);

View File

@ -41,7 +41,7 @@ void setup() {
tft.fillScreen(TFT_BLACK); tft.fillScreen(TFT_BLACK);
// Create a sprite for the graph // Create a sprite for the graph
graph1.setcolorDepth(8); graph1.setColorDepth(8);
graph1.createSprite(128, 61); graph1.createSprite(128, 61);
graph1.fillSprite(TFT_BLUE); // Note: Sprite is filled with black when created graph1.fillSprite(TFT_BLUE); // Note: Sprite is filled with black when created
@ -51,7 +51,7 @@ void setup() {
//graph1.setScrollRect(64, 0, 64, 61, TFT_DARKGREY); // Try this line to change the graph scroll area //graph1.setScrollRect(64, 0, 64, 61, TFT_DARKGREY); // Try this line to change the graph scroll area
// Create a sprite for the scrolling numbers // Create a sprite for the scrolling numbers
stext1.setcolorDepth(8); stext1.setColorDepth(8);
stext1.createSprite(32, 64); stext1.createSprite(32, 64);
stext1.fillSprite(TFT_BLUE); // Fill sprite with blue stext1.fillSprite(TFT_BLUE); // Fill sprite with blue
stext1.setScrollRect(0, 0, 32, 64, TFT_BLUE); // here we set scroll gap fill color to blue stext1.setScrollRect(0, 0, 32, 64, TFT_BLUE); // here we set scroll gap fill color to blue
@ -59,7 +59,7 @@ void setup() {
stext1.setTextDatum(BR_DATUM); // Bottom right coordinate datum stext1.setTextDatum(BR_DATUM); // Bottom right coordinate datum
// Create a sprite for Hello World // Create a sprite for Hello World
stext2.setcolorDepth(8); stext2.setColorDepth(8);
stext2.createSprite(80, 16); stext2.createSprite(80, 16);
stext2.fillSprite(TFT_DARKGREY); stext2.fillSprite(TFT_DARKGREY);
stext2.setScrollRect(0, 0, 40, 16, TFT_DARKGREY); // Scroll the "Hello" in the first 40 pixels stext2.setScrollRect(0, 0, 40, 16, TFT_DARKGREY); // Scroll the "Hello" in the first 40 pixels

View File

@ -84,7 +84,7 @@ void setup() {
Serial.println(" SPIFFS initialisation OK"); Serial.println(" SPIFFS initialisation OK");
frame.setcolorDepth(1); // Must set the bits per pixel to 1 for ePaper displays frame.setColorDepth(1); // Must set the bits per pixel to 1 for ePaper displays
// Set bit depth BEFORE creating Sprite, default is 16! // Set bit depth BEFORE creating Sprite, default is 16!
// Create a frame buffer in RAM of defined size and save the pointer to it // Create a frame buffer in RAM of defined size and save the pointer to it