A simple Pong game with STM32F407VET6 black board (Seeed Arch Max) and ILI9341 320x240 TFT display.

Dependencies:   mbed ILI9341_STM32F4

A simple Pong game with STM32F407VET6 black board (compatible with Seed Arch Max) and ILI9341 320x240 TFT display.

Connect the SPI interface of an ILI9341 320x240 TFT display to the STM32F407VET6 board (Seeed Arch Max) as follows:

ILI9341 TFTSPI interfaceSTM32F407VET6
VCC+5V
GNDGND
CSPB_7
RESETPB_8
D/CPB_6
SDI(MOSI)PB_5
SCKPB_3
LEDover a 56 ohm resistor+5V
SDO(MISO)PB_4
Revision:
1:971e721f6ef2
Parent:
0:887dd664eca0
--- a/Racket.h	Thu Apr 11 20:18:15 2019 +0000
+++ b/Racket.h	Mon Apr 15 06:02:55 2019 +0000
@@ -7,19 +7,20 @@
 class   Racket
 {
 public:
-    Racket(int w = 20, int h = 40, uint16_t clr = TFT_WHITE); 
-    void      move(DigitalIn* btnUp, DigitalIn* btnDown);
-    void      paint(uint16_t clr = TFT_WHITE);
-    
-    int       width;
-    int       height;
-    int       xPos;
-    int       yPos;
-    float     velocity;
-    int       xDir;
-    int       yDir;
-    bool      moved;    
-    uint16_t  color;
+    Racket(int w = 20, int h = 40, uint16_t clr = TFT_WHITE);
+    void        home();
+    void        move(DigitalIn* btnUp, DigitalIn* btnDown);
+    void        paint();
+
+    int         width;
+    int         height;
+    int         xPos;
+    int         yPos;
+    int         yPosOld;
+    float       velocity;
+    int         xDir;
+    int         yDir;
+    bool        moved;
+    uint16_t    color;
 };
-
 #endif // RACKET_H