Creating an Animation Sprite on TTGO T-Watch

by Bavensky in Circuits > Wearables

1080 Views, 3 Favorites, 0 Comments

Creating an Animation Sprite on TTGO T-Watch

IMG_5372.JPG

Download and Install KBIDE

5.JPG
9.JPG

Download here : www.kbide.org

Install TTGO T-Watch V1.0.1

0.JPG

Select T-Watch Board

1.JPG

Click Example & Tutorials

3.JPG

Open Board Example → 02-DISPLAY → 04-Animation

4.JPG
5.JPG

How Is Work ?

2.JPG
3.JPG
4.JPG
5.JPG

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

Compile & Run to See What Happen !