commit 91e17fb460b35ffb62aa5f7814248922426c3996 Author: letuaillon Date: Fri May 12 08:39:30 2023 +0200 bandeau bleu diff --git a/notes b/notes new file mode 100644 index 0000000..0d8a251 --- /dev/null +++ b/notes @@ -0,0 +1,6 @@ +#Faire bouger la boule avec le gyroscope + +#Delai Durée tp1= millis() #temps depuis que le programme a commencé + +#stockage des données les pièces ?! + diff --git a/tpnot_/tpnot_.ino b/tpnot_/tpnot_.ino new file mode 100644 index 0000000..0257d59 --- /dev/null +++ b/tpnot_/tpnot_.ino @@ -0,0 +1,57 @@ +#include // Include the library for the LCD screen + +TFT_eSPI tft = TFT_eSPI(); // Create an instance of the library +//Constantes : +//couleurs : +#define TFT_BLACK 0x0000 /* 0, 0, 0 */ +#define TFT_NAVY 0x000F /* 0, 0, 128 */ +#define TFT_DARKGREEN 0x03E0 /* 0, 128, 0 */ +#define TFT_DARKCYAN 0x03EF /* 0, 128, 128 */ +#define TFT_MAROON 0x7800 /* 128, 0, 0 */ +#define TFT_PURPLE 0x780F /* 128, 0, 128 */ +#define TFT_OLIVE 0x7BE0 /* 128, 128, 0 */ +#define TFT_LIGHTGREY 0xC618 /* 192, 192, 192 */ +#define TFT_DARKGREY 0x7BEF /* 128, 128, 128 */ +#define TFT_BLUE 0x001F /* 0, 0, 255 */ +#define TFT_GREEN 0x07E0 /* 0, 255, 0 */ +#define TFT_CYAN 0x07FF /* 0, 255, 255 */ +#define TFT_RED 0xF800 /* 255, 0, 0 */ +#define TFT_MAGENTA 0xF81F /* 255, 0, 255 */ +#define TFT_YELLOW 0xFFE0 /* 255, 255, 0 */ +#define TFT_WHITE 0xFFFF /* 255, 255, 255 */ +#define TFT_ORANGE 0xFDA0 /* 255, 180, 0 */ +#define TFT_GREENYELLOW 0xB7E0 /* 180, 255, 0 */ + +// Parameters for the game +String level = "Novice"; // Example for level +int score = 0; // Initial score +int timeLeft = 30; // Initial time + +void setup() { + tft.begin(); // Start the screen + tft.setRotation(3); // Rotate the screen to the correct orientation + + // Draw the blue banner + tft.fillRoundRect(0, 0, 320, 40, 0, TFT_BLUE); + + // Set the color and size of the text + tft.setTextColor(TFT_WHITE, TFT_BLUE); + tft.setTextSize(2); + + // Display the level, score and time + tft.drawString(level, 10, 10); + tft.drawString(String(score)+" pts", 160, 10); + tft.drawString(String(timeLeft), 290, 10); +} + +void loop() { + // Update the score and time every second + delay(1000); + tft.fillRoundRect(0, 0, 320, 40, 0, TFT_BLUE); + tft.drawString(level, 10, 10); + tft.drawString(String(score)+" pts", 160, 10); + tft.drawString(String(timeLeft), 290, 10); + + // Update the game parameters here + // ... +}