Skocz do zawartości

Płynny ruch na wyświetlaczu TFT - jak uzyskać?


Pomocna odpowiedź

Napisano

Witam!

Mam problem z nie potrafię stworzyć płynnego ruchu piłki w moim programie.

Proszę o wyrozumiałość z uwagi na to ,że o nie dawna interesuję się informatyką.

Moje biblioteki: Adafruit_TFTLCD, Adafruit_GFX.h.

Mój wyświetlacz:

Wyświetlacz dotykowy 2.8'' TFT Arduino

 

Proszę bardzo!

#include <Adafruit_TFTLCD.h> 
#include <Adafruit_GFX.h>    
#include <TouchScreen.h>

#define LCD_CS A3 
#define LCD_CD A2 
#define LCD_WR A1 
#define LCD_RD A0 
#define LCD_RESET A4 

#define TS_MINX 122
#define TS_MINY 111
#define TS_MAXX 942
#define TS_MAXY 890

#define YP A3
#define XM A2
#define YM 9
#define XP 8

#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF
int x = 125;
int y = 150;
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);



void setup() {
  
  tft.reset();
  uint16_t identifier = tft.readID();
  tft.begin(identifier);
  tft.setRotation(2);
  tft.fillScreen(BLACK);

}

void loop() {
  
   tft.fillCircle(x, y, 1, GREEN);
   (10);
   tft.fillScreen(BLACK);
 
   x = x+1;
   
   y = y+1;
}

 

Bądź aktywny - zaloguj się lub utwórz konto!

Tylko zarejestrowani użytkownicy mogą komentować zawartość tej strony

Utwórz konto w ~20 sekund!

Zarejestruj nowe konto, to proste!

Zarejestruj się »

Zaloguj się

Posiadasz własne konto? Użyj go!

Zaloguj się »
×
×
  • Utwórz nowe...