Skip to content
Discussion options

You must be logged in to vote

Here is the code that is close to your needs. It uses other useful functions:

#include <TFT_eSPI.h>
TFT_eSPI    tft = TFT_eSPI();
TFT_eSprite SPR = TFT_eSprite(&tft);

#define BLK 1
int Variable_x = 40; //variable init

void setup() {
  pinMode(BLK, OUTPUT); //backlight control
  analogWrite(BLK, 255);

  tft.begin();
  tft.init();
  tft.fillScreen(TFT_BLACK);
}

void loop() {

  if (Variable_x >= 205) { //ending point
    Variable_x = 40; //starting point
  }
  SPR.createSprite(240, 100); // created evey loop so gets cleared to black
  SPR.setTextDatum(MR_DATUM);
  SPR.setTextColor(TFT_BLACK);
  SPR.fillCircle(40, 60, 10 , TFT_YELLOW); // Note: Diameter will be 21 pixels
  SPR.fillCircle…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Bodmer
Comment options

@MrBroccoliJP
Comment options

Comment options

You must be logged in to vote
2 replies
@MrBroccoliJP
Comment options

@Bodmer
Comment options

Answer selected by MrBroccoliJP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants