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 TFT | SPI interface | STM32F407VET6 |
---|---|---|
VCC | +5V | |
GND | GND | |
CS | PB_7 | |
RESET | PB_8 | |
D/C | PB_6 | |
SDI(MOSI) | PB_5 | |
SCK | PB_3 | |
LED | over a 56 ohm resistor | +5V |
SDO(MISO) | PB_4 |
Ball.h
- Committer:
- hudakz
- Date:
- 2019-04-11
- Revision:
- 0:887dd664eca0
- Child:
- 1:971e721f6ef2
File content as of revision 0:887dd664eca0:
#ifndef BALL_H #define BALL_H #include "mbed.h" #include "tft.h" class Racket; class Ball { int size; float velocity; bool gameOver; uint16_t color; Timeout timeout; public: Ball(int s = 8, float v = 8, uint16_t clr = TFT_WHITE ); bool move(Racket* rkt); void newGame(); void paint(uint16_t clr); void vec2_norm(float& x, float &y); int xPos; int yPos; float xDir; float yDir; }; #endif // BALL_H