Introduction: Creating an Animation Sprite on TTGO T-Watch

Step 1: Download and Install KBIDE

Download here : www.kbide.org

Step 2: Install TTGO T-Watch V1.0.1

Step 3: Select T-Watch Board

Step 4: Click Example & Tutorials

Step 5: Open Board Example → 02-DISPLAY → 04-Animation

Step 6: How Is Work ?

Setup:
1) Set IO36 to INPUT_PULLUP
2) Set display rotation to TOP.
3) Fill screen display to WHITE.
4) Create variable delayAnime (Time(ms) to display animation)
5) posX (Position X)
6) posY (Position Y)
7) pevX (Previous Position X)
8) walk state
9) Display Text on Screen
10 ) add your animation image to variable name basePage11) draw image from basePage to display screen

Loop:
1) Condition IF : GPIO36 (USER Button was Press)
2) Set variable walk to True
3) Condition IF : variable walkis True
4) add your animation image to variable name img1
5) draw image from img1 to display screen
6) delay image to display
n) Follow number 4–6 to display your animation sprite


Task:
1) Run task
2) Do task every 0.5 Seconds
3) Condition IF : variable walkis True
4) update position X
5) update previous position X
6) Remove Screen before display next image
7) Condition IF : variable posX ≥ 240 (display pixel 240x240) will set position X to 0 (zero) and set variable walk is False to stop the animation

NOTE:
Example folder already contains example images. You can try it at Board Folder → ttgo-t-watch→ examples → 02-DISPLAY → 04-Animation

Step 7: Compile & Run to See What Happen !