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
Committer:
hudakz
Date:
Mon Apr 15 06:02:55 2019 +0000
Revision:
1:971e721f6ef2
Parent:
0:887dd664eca0
Simple pong game updated.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 0:887dd664eca0 1 #ifndef BALL_H
hudakz 0:887dd664eca0 2 #define BALL_H
hudakz 0:887dd664eca0 3
hudakz 0:887dd664eca0 4 #include "mbed.h"
hudakz 0:887dd664eca0 5 #include "tft.h"
hudakz 0:887dd664eca0 6
hudakz 0:887dd664eca0 7 class Racket;
hudakz 0:887dd664eca0 8
hudakz 0:887dd664eca0 9 class Ball
hudakz 0:887dd664eca0 10 {
hudakz 0:887dd664eca0 11 int size;
hudakz 0:887dd664eca0 12 float velocity;
hudakz 0:887dd664eca0 13 uint16_t color;
hudakz 0:887dd664eca0 14 public:
hudakz 1:971e721f6ef2 15 Ball(int s = 8, float v = 4, uint16_t clr = TFT_WHITE );
hudakz 1:971e721f6ef2 16 void home();
hudakz 0:887dd664eca0 17 bool move(Racket* rkt);
hudakz 1:971e721f6ef2 18 void paint();
hudakz 0:887dd664eca0 19 void vec2_norm(float& x, float &y);
hudakz 0:887dd664eca0 20
hudakz 0:887dd664eca0 21 int xPos;
hudakz 1:971e721f6ef2 22 int yPos;
hudakz 1:971e721f6ef2 23 int xPosOld;
hudakz 1:971e721f6ef2 24 int yPosOld;
hudakz 0:887dd664eca0 25 float xDir;
hudakz 0:887dd664eca0 26 float yDir;
hudakz 0:887dd664eca0 27
hudakz 0:887dd664eca0 28 };
hudakz 0:887dd664eca0 29 #endif // BALL_H