22- Selecting playing time and increment

La primera part del projecte està basada en jugar amb rellotge, evidentment això vol dir que el taulell permetrà jugar contra l'ordinador i contra un altre jugador. Les partides doncs estaran controlades pel botóns dels jugadors en qualsevol dels dos casos, això signifaica que, al jugar human vs computer el jugador haurà de clicar el botó per ell i per la màquina. Amb la futura implementació de jugar sense temps això no caldrà però de moment tiro per aquest camí.

La primera parte del proyecto está basada en jugar con reloj, evidentemente esto quiere decir que el tablero permitirá jugar contra el ordenador y contra otro jugador. Las partidas pues estarán controladas por botones de los jugadores en cualquiera de los dos casos, esto significa que, al jugar human vs computer el jugador deberá pulsar el botón por él y por la máquina. Con la futura implementación de jugar sin tiempo esto no será necesario pero de momento tiro por este camino.

The first part of the project is based on playing with a clock, obviously this means that the board will allow you to play against the computer and against another player. The games will be controlled by the players' buttons in either case, this means that when playing human vs computer the player will have to click the button for him and the machine. With the future implementation of playing without time this will not be necessary but for now I shoot this way.



Amb aquest configuració s'accedeix a la tft i a través dels botonets i les conexions que he utilitzat es pot aplicar el codi de sota per la tria dels temps tal i com es veu al video. També hi he afegit una capçalera amb el cap d'un caball.

Con esta configuración se accede a la tft y a través de los botones y las conexiones que he utilizado se puede aplicar el código de abajo para la elección de los tiempos tal y como se ve en el video. También he añadido una cabecera con la cabeza de un caballo.

With this setting you can access the tft and through the buttons and connections I used you can apply the code below for the choice of times as seen in the video. I also added a header with the head of a horse.


#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include "Adafruit_ILI9341.h" //llibreria per la tft

#define TFT_DC A1 //PIN DC del SPI pot ser qualsevol
#define TFT_CS A0 //PIN CS del SPI pot ser qualsevol
//pantalla tft
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);


//the logo: a knight
const unsigned char caratula[] PROGMEM=
//0 10 20 30 40 50 60 70 80 90 100
// 12345678 90123456 78901234 56789012 34567890 12345678 90123456 78901234 56789012 34567890 12345678 901234567 890
{ B00000000, B00000000, B00000000,B00000000,B00000000,B00000000,B00000000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00000000,B00000000,B00000000,B00000000,B00000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00000000,B00000000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00000000,B00000000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000100, B00000000,B00000000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000100, B00000000,B00000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000010, B00000000,B00000000,B00000000,B10000000,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000011, B00000000,B00000000,B00000010,B00000000,B01110010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000011, B00000000,B00000000,B00000110,B00000001,B10000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000011, B11000000,B00000000,B00000111,B00000111,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000001, B11110000,B00000000,B00001110,B00001000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000001, B00011100,B00000000,B00110100,B11100000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B11000111,B00000001,B11000011,B11100000,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B11000011,B10000000,B11100001,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B11000000,B11000011,B10000000,B00000000,B00000010,B00000000,B00001111,B11010000,B00000000,B00000000,B00000000,
B00000000, B00000000, B11100000,B00111110,B00000000,B00000000,B00000001,B11111111,B11111000,B00011110,B00000000,B00000000,B00000000,
B00000000, B00000000, B11100000,B00011100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111000,B00000000,B00000000,
B00000000, B00000000, B10110000,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B10000001,B11111000,B00000000,
B00000000, B00000000, B10011100,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,
B00000000, B00000000, B10001100,B00000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00000000,B00000000,B00000000,
B00000000, B00000000, B10000110,B00000000,B10000000,B00000000,B00000000,B00000000,B00000000,B11000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B10000011,B00000000,B01000000,B00000000,B00000000,B00000000,B00000000,B10000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B11000001,B10000000,B01000000,B00000000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,
B11100000, B00000000, B01000000,B11000000,B01000000,B00000011,B00000000,B00000000,B00000010,B10000000,B00000000,B00000000,B00000000,
B01100000, B00000000, B01000000,B11000000,B01000000,B00000001,B00000000,B00010000,B00000010,B00000000,B00000000,B00000000,B00000000,
B00100010, B10000000, B10000000,B01100000,B01100100,B00000000,B00100000,B01101000,B00000001,B11000000,B00000000,B00000000,B00000000,
B00010000, B00101010, B11100000,B11000000,B11000111,B11000000,B00010000,B01001100,B00000000,B11100000,B00000000,B00000000,B00000000,
B00010000, B00000000, B00111100,B00100000,B11100100,B00000000,B00110000,B00101110,B00000000,B00110000,B00000000,B00000000,B00000000,
B00011000, B00000000, B00001111,B00100011,B01000001,B00011000,B00101000,B00100010,B00000000,B00001100,B00000000,B00000000,B00000000,
B00001100, B00000000, B00000110,B00000011,B10111011,B00001100,B00101000,B00100011,B00000000,B00001111,B10000000,B00000000,B00000000,
B00000100, B00000000, B00001100,B00000100,B10001001,B10110001,B10001100,B00000000,B00011111,B00000000,B00000000,B00000000,B00000000,
B00000010, B00000000, B00011000,B00000000,B00001001,B00000001,B10100100,B00000000,B11000000,B00000001,B11111110,B00000000,B00000000,
B00000001, B00000000, B00110000,B00000000,B00011101,B00000001,B11100100,B01000000,B01100000,B00000000,B00000111,B00000000,B00000000,
B00000000, B11111000, B11000000,B00000000,B00001111,B00000000,B11100110,B11000000,B00110000,B00000000,B00000000,B11100000,B00000000,
B00000000, B00111111, B11000000,B00000000,B00000111,B00000000,B01000110,B11000000,B00011000,B00000000,B00000001,B11000000,B00000000,
B00000000, B00000001, B10000000,B00000000,B00000011,B00000000,B10000010,B10000000,B00011000,B00000000,B00000011,B00000000,B00000000,
B00000000, B00000011, B00000000,B00000000,B00000001,B00000000,B00000110,B00000000,B00001100,B00000000,B00000011,B00000000,B00000000,
B00000000, B00000010, B00000000,B00000000,B00000011,B00000000,B00000111,B00000000,B00000110,B00000000,B00000001,B10000000,B00000000,
B00000000, B00000110, B00000000,B00000000,B00000011,B00000000,B00000111,B00000000,B00000110,B00000000,B00000001,B10000000,B00000000,
B00000000, B00000110, B00000010,B00000000,B00000011,B00000000,B00000110,B00000000,B00000110,B00000000,B00000001,B10000000,B00000000,
B00000000, B00000100, B00001110,B00000000,B00000010,B00000000,B00000100,B00000000,B00000011,B00000000,B00000001,B11000000,B00000000,
B00000000, B00001100, B00001111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000011,B10000000,B00000001,B11100000,B00000000,
B00000000, B00001100, B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B00000000,B00000001,B00110000,B00000000,
B00000000, B00011000, B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000001,B10000000,B00000001,B10110000,B00000000,
B00000000, B00011000, B00011001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000001,B10001100,B00000000,
B00000000, B00110000, B00111011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B10001010,B00000000,
B00000000, B00110000, B01110110,B00000000,B00000000,B00000000,B00010000,B00000000,B00000011,B10000000,B00000000,B11000110,B00000000,
B00000000, B00110000, B01100110,B00000000,B00000000,B00000000,B00001000,B00000000,B00000011,B00000000,B00000000,B11100000,B00000000,
B00000000, B00110000, B01111100,B00000000,B00000000,B00000000,B00001100,B00000000,B00000011,B00111000,B00000000,B01110000,B00000000,
B00000000, B00010000, B11100000,B00000000,B00000000,B00000000,B00011000,B00000000,B00000011,B01011000,B00000000,B01100000,B00000000,
B00000000, B00010000, B11000000,B00000000,B00000000,B00000000,B01001100,B00000000,B00000010,B11001110,B00000000,B00011000,B00000000,
B00000000, B00010000, B11000000,B00000000,B00000000,B00000001,B10011100,B00000000,B00000011,B10000111,B00000000,B00011000,B00000000,
B00000000, B00010000, B01000000,B00000000,B00000000,B00000000,B11001100,B00000000,B00000011,B00000001,B10000000,B00001100,B00000000,
B00000000, B00010000, B01100000,B00000000,B00000000,B00000000,B10001100,B00000000,B00000011,B00000000,B10000000,B00000011,B00000000,
B00000000, B00010000, B00000000,B00000000,B00000000,B00000001,B00011000,B00000000,B00000010,B00000000,B00000000,B00000001,B00000000,
B00000000, B00010000, B00000000,B00000000,B00000000,B00000001,B01111101,B00000000,B00000100,B00000001,B10000000,B00000001,B10000000,
B00000000, B00010000, B00000000,B00000000,B00000000,B00000010,B11001110,B00000000,B00001110,B00000001,B10000000,B00000000,B01000000,
B00000000, B00010000, B00000000,B00000000,B00000000,B00000100,B11100110,B00000000,B00011100,B00000001,B10000000,B00000000,B01100000,
B00000000, B00010000, B00000000,B00000000,B00000000,B00000001,B11000000,B10000000,B00111000,B00000000,B10000000,B00000000,B00100000,
B00000000, B00010000, B00000000,B00000000,B00000000,B00000111,B00000000,B11000000,B00000000,B00000011,B00000000,B00001111,B11100000,
B00000000, B00110001, B00000000,B00000000,B00000000,B00001110,B00000001,B10000000,B00000000,B00000001,B10000000,B00011000,B01100000,
B00000000, B00110011, B00000000,B00000000,B00000000,B00011100,B00000001,B11000000,B00000000,B00000001,B00000000,B00010000,B00000000,
B00000000, B00100010, B00000000,B00000000,B00000000,B00111000,B00000001,B10000000,B00000000,B00000001,B00000000,B00110000,B00000000,
B00000000, B00100010, B00000000,B00000000,B00000000,B00110000,B00000001,B00000000,B00000000,B00000001,B00000000,B00100000,B00000000,
B00000000, B00100010, B00000000,B00000000,B00000000,B01100000,B00000011,B00000000,B00000000,B00000011,B00000000,B00100000,B00000000,
B00000000, B01100010, B00000000,B00000100,B00000000,B11000000,B00000010,B00010000,B00000000,B00000010,B00000000,B00110000,B00000000,
B00000000, B01100010, B00000000,B00000010,B10101000,B11000000,B00000110,B00110000,B00000000,B00000010,B00000000,B00110000,B00000000,
B00000000, B01000110, B00000000,B00000001,B11000111,B00000000,B00000100,B00010000,B00000000,B00000100,B00000000,B00010000,B00000000,
B00000000, B01000110, B00000000,B00001000,B00111000,B00000000,B00001000,B00010000,B00110000,B00000000,B00000000,B00010000,B00000000,
B00000000, B10000100, B00000000,B00000110,B00100000,B00000000,B00110000,B00100000,B10000000,B00001000,B00000000,B00001000,B00000000,
B00000000, B10001000, B00000000,B01100100,B01100000,B00000000,B01100000,B00100001,B10000000,B00010000,B00000000,B00001000,B00000000,
B00000000, B10000000, B00000000,B11110000,B11000000,B00000000,B11000110,B00000000,B00000000,B00110000,B00000000,B00001000,B00000000,
B00000001, B00000000, B01000000,B10010001,B10000000,B00000001,B10000000,B01000001,B00000000,B00100000,B00000000,B00001100,B00000000,
B00000001, B00000000, B01000001,B10011011,B00000000,B00000011,B10000001,B10000011,B00000000,B00100000,B00000000,B00001100,B00000000,
B00000011, B00000000, B01000001,B00010001,B00000000,B00000111,B00000001,B10000010,B00000000,B01000000,B00000000,B00000100,B00000000,
B00000110, B11000000, B01000110,B11000110,B00000000,B00011100,B00000011,B00000100,B00000000,B00000000,B00000000,B00000100,B00000000,
B00000010, B11000000, B11001011,B00000110,B00000000,B00011000,B00000010,B00001000,B00000011,B00000000,B00000000,B00000100,B00000000,
B00000011, B11000000, B11000101,B00000100,B00000000,B00010000,B00000100,B00010000,B00000110,B00000000,B00000000,B00000100,B00000000,
B00000010, B11000000, B10001011,B00001100,B00000000,B00100000,B00001100,B00110000,B00001111,B00000000,B00000000,B00101000,B00000000,
B00000001, B00000000, B00001010,B00000100,B00000000,B10000000,B00011000,B01100000,B00011111,B00000000,B00000000,B11011000,B00000000,
B00000001, B00000000, B00011010,B00001100,B00000000,B10000000,B00010000,B01100000,B00111001,B10000000,B00000011,B10011000,B00000000,
B00000001, B10000000, B00010100,B00001100,B00000001,B00000000,B00110000,B01000000,B01110001,B10000000,B00000111,B00011000,B00000000,
B00000000, B10000000, B00110100,B00001000,B00000011,B00000000,B01100000,B10000000,B11100001,B10000000,B00001100,B00011000,B00000000,
B00000000, B11000000, B00110100,B01110000,B00000110,B00000000,B11000001,B00000000,B11000001,B00000000,B00011100,B00010000,B00000000,
B00000000, B11000000, B00100111,B11000000,B00001110,B00000000,B10000010,B00000000,B00000011,B00000000,B00011100,B00000000,B00000000,
B00000000, B01100000, B01001110,B00000000,B00110000,B00000010,B00001100,B00000000,B00000011,B00000000,B01110000,B00000000,B00000000,
B00000000, B00110000, B11000110,B00000000,B00110000,B00000010,B00001100,B00000000,B00000110,B00000000,B11100000,B00000000,B00000000,
B00000000, B00011011, B10000100,B00000000,B01100000,B00001000,B00011000,B00000000,B00000100,B00000000,B11000000,B00000000,B00000000,
B00000000, B00000111, B00000000,B00000000,B11000000,B00001100,B00010000,B00000000,B00001000,B00000000,B11000000,B00000000,B00000000,
B00000000, B00000000, B00000000,B00000001,B10000000,B00011000,B00110000,B00000000,B00001000,B00000000,B11000000,B00000000,B00000000,
B00000000, B00000000, B00000000,B00000011,B00000000,B00110000,B00000000,B00000000,B00001000,B00000000,B11000000,B00000000,B00000000,
B00000000, B00000000, B00000000,B00000110,B00000000,B01100000,B00000000,B00000000,B00010000,B00000000,B00110000,B00000000,B00000000,
B00000000, B00000000, B00000000,B00001100,B00000000,B00000000,B00000000,B00000000,B00010000,B00000000,B00011000,B00000000,B00000000,
B00000000, B00000000, B00000000,B00011000,B00000000,B00000000,B00000000,B00000000,B00010000,B00000000,B00011000,B00000000,B00000000,
B00000000, B00000000, B00000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00110000,B00000000,B10001100,B00000000,B00000000,
B00000000, B00000000, B00000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00110000,B00000111,B11111100,B00000000,B00000000,
B00000000, B00000000, B00000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00001100,B00000110,B00000000,B00000000,
B00000000, B00000000, B00000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011000,B00000011,B00000000,B00000000,
B00000000, B00000000, B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00010000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00001100,B00000000,B00000000,B00000000,
B00000000, B00000000, B11000000,B00111000,B10000000,B00000000,B00000000,B00000000,B00111100,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000001, B10000000,B01100000,B11000000,B00000000,B00000000,B00000000,B00110000,B00000001,B11000000,B00000000,B00000000,
B00000000, B00000001, B10000000,B00100000,B01000000,B00000000,B00000000,B00000000,B01100000,B00000000,B11100000,B00000000,B00000000,
B00000000, B00000001, B00000000,B01000000,B01000000,B00000000,B00000000,B00000000,B00110000,B00000000,B01110000,B00000000,B00000000,
B00000000, B00000011, B00000000,B00000000,B01000000,B00000000,B00000000,B00000000,B00100000,B00000000,B00001110,B00000000,B00000000,
B00000000, B00000011, B00000000,B00000000,B01000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,
B00000000, B00000010, B00000000,B00000000,B11000000,B00000000,B00000001,B10000000,B00000011,B11110001,B10000000,B00000000,B00000000,
B00000000, B00000010, B00000000,B00000000,B10000000,B00000000,B00000000,B00000000,B01001100,B00010111,B00000000,B00000000,B00000000,
B00000000, B00000010, B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B11111100,B00001110,B00000000,B00000000,B00000000,
B00000000, B00000011, B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B11100000,B00011000,B00000000,B00000000,B00000000,
B00000000, B00000011, B00000000,B00000011,B00000000,B00000000,B00000000,B00000001,B10000000,B01100000,B00000000,B00000000,B00000000,
B00000000, B00000001, B00000000,B00000011,B00000000,B00000000,B00000000,B00000011,B00000000,B11000000,B00000000,B00000000,B00000000,
B00000000, B00000001, B10000000,B00000010,B00000000,B00000000,B00000000,B00000110,B00000011,B10000000,B00000000,B00000000,B00000000,
B00000000, B00000001, B10000000,B00000100,B00000000,B00000000,B00000000,B00001100,B00000111,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B10000000,B00001000,B00000000,B00000000,B00000000,B00010000,B00001110,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B01000000,B00011000,B00000000,B00000000,B00000000,B01110000,B00001110,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00100000,B00110000,B00000000,B00000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00010000,B11100000,B00000000,B00000000,B00000000,B00000000,B00001100,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00011000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00000110,B00000000,B11111111,B00000000,B00000000,B00000000,B00011000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00000110,B00000011,B00000000,B00111111,B00000000,B00000000,B00110000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00000011,B00000000,B00000000,B00000001,B11111000,B00000000,B00100000,B00000000,B00000000,B00000000,B00000000,
B00000000, B00000000, B00000011,B00000000,B00000000,B00000000,B00000011,B11100111,B00100000,B00000000,B00000000,B00000000,B00000000};
};


int btnSegMin=0;

int increment=0;
int minuts=0;
int btnOk=1;

void setup() {

pinMode(btnSegMin,INPUT);
pinMode(btnOk,INPUT);


tft.begin();
uint8_t x = tft.readcommand8(ILI9341_RDMODE);
tft.setRotation(3); //escriu en horitzontal
tft.setTextSize(2);
tft.fillScreen(ILI9341_BLACK);
yield();
tft.setCursor(0,0);
tft.drawBitmap(110,30,caratula,104,128,ILI9341_YELLOW); //dibuix del caball
delay(500);
tft.setCursor(60,180);
tft.setTextColor(ILI9341_YELLOW);
tft.print("Taulell JacMat!!");
delay(5000);
tft.fillScreen(ILI9341_BLACK);
// Keyboard.begin();

//******************************** HEADER *******************************
//***************************** SELECCIO TEMPS *****************************

tft.setTextColor(ILI9341_WHITE);
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(0,20);
tft.setTextSize(2);
tft.print("Tria l'increment de temps:");
tft.setTextSize(3);
tft.setCursor(150,80);
tft.print(increment);

//seleccio increment de temps
while(digitalRead(btnOk)==LOW)
{
if(digitalRead(btnSegMin)==HIGH)
{
tft.setTextColor(ILI9341_BLACK); //pinto el numere de negre i dspres escric a sobre
tft.setCursor(150,80); //el nou numero en blanc
tft.print(increment);
increment++;
tft.setTextColor(ILI9341_WHITE);
tft.setCursor(150,80);
tft.print(increment);
delay(250);
}
}
//faig servir la mateixa variable pels minuts
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(0,20);
tft.setTextSize(2);
tft.print("Increment: ");
tft.print(increment);
tft.print("s");
delay(250);
tft.setCursor(0,40);
tft.print("Tria els minuts de joc:");
tft.setTextSize(3);
tft.setCursor(150,80);
tft.print("0");

while(digitalRead(btnOk)==LOW)
{
if(digitalRead(btnSegMin)==HIGH)
{
tft.setTextColor(ILI9341_BLACK);
tft.setCursor(150,80);
tft.print(minuts);
minuts++;
tft.setTextColor(ILI9341_WHITE);
tft.setCursor(150,80);
tft.print(minuts);
delay(250);
}
}
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(0,20);
tft.setTextSize(2);
tft.print("Increment: ");
tft.print(increment);
tft.print("'");
tft.setCursor(0,40);
tft.print("Minuts de joc: ");
tft.print(minuts);
tft.print("''");
tft.setTextColor(ILI9341_GREEN);
tft.setCursor(100,100);
if(minuts>9){tft.setCursor(80,100);}
tft.setTextSize(4);
tft.print(minuts);
tft.print(" + ");
tft.print(increment);
tft.setCursor(0,220);
tft.setTextSize(1);
tft.setTextColor(ILI9341_WHITE);
tft.print("clica 'OK' per iniciar la partida");
}

//******************* LOOP *************************
//***********************************************************



void loop() {

}

Comentaris

Entrades populars d'aquest blog

45.- Weighting the pieces

3.- Sensors II

21.- Electronic scheme (updated 26/08/2020)