Library to calculate movement and to draw the objects in the pong game

Dependencies:   RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed

Fork of MainSketch by IoT Ox

Committer:
tunagonen
Date:
Wed May 24 15:18:13 2017 +0000
Revision:
11:d812de0e5136
Parent:
9:eee503060d69
l

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mlin 9:eee503060d69 1 #include "stdio.h"
mlin 9:eee503060d69 2 #include "SPI_TFT_ILI9341.h"
mlin 9:eee503060d69 3 #include "string"
mlin 9:eee503060d69 4 #include "Arial12x12.h"
mlin 9:eee503060d69 5 #include "Arial24x23.h"
mlin 9:eee503060d69 6 #include "Arial28x28.h"
mlin 9:eee503060d69 7 #include "font_big.h"
mlin 9:eee503060d69 8
mlin 9:eee503060d69 9 // example to test the TFT Display from Mikroelectronika
mlin 9:eee503060d69 10
mlin 9:eee503060d69 11
mlin 9:eee503060d69 12
mlin 9:eee503060d69 13
mlin 9:eee503060d69 14
mlin 9:eee503060d69 15
mlin 9:eee503060d69 16
mlin 9:eee503060d69 17
mlin 9:eee503060d69 18 // the display has a backlight switch on board
mlin 9:eee503060d69 19 //DigitalOut LCD_LED(PTA4); // may not be needed on mikroelectronika board
mlin 9:eee503060d69 20 //DigitalOut pwr(PTD7); // ditto
mlin 9:eee503060d69 21
mlin 9:eee503060d69 22 // the TFT is connected to SPI pin 5-7
mlin 9:eee503060d69 23 //SPI_TFT_ILI9341 TFT(p5, p6, p7, p8, p9, p10,"TFT"); // mosi, miso, sclk, cs, reset, dc for lpc1768
mlin 9:eee503060d69 24 SPI_TFT_ILI9341 TFT(PTD6, PTD7, PTD5, PTD2, PTD4, PTA13,"TFT"); // mosi, miso, sclk, cs, reset, dc for frdmkl25z
mlin 9:eee503060d69 25 //NB better combination to use a coherent 2x4 block for lcd
mlin 9:eee503060d69 26 // SPI_TFT_ILI9341 TFT(PTD2, PTD3, PTD1, PTA16, PTA17, PTC16,"TFT"); // mosi, miso, sclk, cs, reset, dc for frdmkl25z
mlin 9:eee503060d69 27 // DigitalOut LCD_LED(PTC17);
mlin 9:eee503060d69 28 int touching=0;
mlin 9:eee503060d69 29
mlin 9:eee503060d69 30 // Subroutine to read the x location of the touch point
mlin 9:eee503060d69 31 // need to set x+ to 3V and ground x- then read analogue voltage on ym
mlin 9:eee503060d69 32 //nb need to add a check for actual touch as opposed to random crap
mlin 9:eee503060d69 33
mlin 9:eee503060d69 34
mlin 9:eee503060d69 35
mlin 9:eee503060d69 36
mlin 9:eee503060d69 37 void drawbuttons()
mlin 9:eee503060d69 38 {
mlin 9:eee503060d69 39 TFT.fillrect(0,0,50,50,Red);
mlin 9:eee503060d69 40 TFT.fillrect(0,50,50,100,Green);
mlin 9:eee503060d69 41 TFT.fillrect(0,100,50,150,Blue);
mlin 9:eee503060d69 42 TFT.fillrect(0,150,50,200,White);
mlin 9:eee503060d69 43 TFT.fillrect(0,200,50,250,Black);
mlin 9:eee503060d69 44
mlin 9:eee503060d69 45 TFT.rect(0,0,50,50,White);
mlin 9:eee503060d69 46 TFT.rect(0,50,50,100,White);
mlin 9:eee503060d69 47 TFT.rect(0,100,50,150,White);
mlin 9:eee503060d69 48 TFT.rect(0,150,50,200,White);
mlin 9:eee503060d69 49 TFT.rect(0,200,50,250,White);
mlin 9:eee503060d69 50 }