Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • geiin-ese-but3-sae/synthetiseur-intelligent
1 result
Show changes
Commits on Source (2)
......@@ -15,6 +15,7 @@
}
header {
width: 100%;
height: 10%;
background-color: #87CEEB;
color: white;
text-align: center;
......@@ -38,8 +39,7 @@
position: relative;
width: 95vw; /* Takes up 95% of viewport width */
margin-top: 60px;
height: 60vh; /* Sets a reasonable height relative to screen */
max-width: 1200px; /* Optional: prevents it from getting too wide on large screens */
height: 80vh; /* Sets a reasonable height relative to screen */
}
.key {
flex: 1; /* Makes white keys evenly distribute the width */
......@@ -93,7 +93,7 @@
header { padding: 8px 0; font-size: 0.8em; }
}
header img {
height: 80px; /* Taille raisonnable pour le logo */
height: 80%; /* Taille raisonnable pour le logo */
margin-right: 15px; /* Espace entre l'image et le texte */
margin-left: 20px; /* Marge à gauche pour ne pas coller au bord */
}
......
......@@ -9,6 +9,9 @@ const char *password = "GEII2024GAMING";
// Pin where the buzzer is connected
#define BUZZER_PIN 14
#define RXD2 16 // RX pin for ESP32 (can be changed)
#define TXD2 17 // TX pin for ESP32 (can be changed)
// Note frequencies (in Hz) for 25 keys (C4 to C6)
const int NOTE_FREQUENCIES[] = {
261, 277, 293, 311, 329, 349, 370, 392, 415, 440, 466,
......@@ -31,6 +34,16 @@ void handleRoot()
file.close();
}
void handleImage() {
File file = SPIFFS.open("/iutlogo.png", "r");
if (!file) {
server.send(404, "text/plain", "Image Not Found");
return;
}
server.streamFile(file, "image/png"); // Type MIME pour PNG
file.close();
}
// Function to handle note playback via URL
void handlePlayNote()
{
......@@ -40,6 +53,7 @@ void handlePlayNote()
if (noteIndex >= 0 && noteIndex < 25)
{
int frequency = NOTE_FREQUENCIES[noteIndex];
Serial2.println(frequency);
Serial.println(frequency);
}
}
......@@ -50,6 +64,8 @@ void setup()
{
Serial.begin(115200);
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
// Initialize SPIFFS
if (!SPIFFS.begin(true))
{
......@@ -66,6 +82,7 @@ void setup()
// Setup the web server
server.on("/", handleRoot);
server.on("/play", handlePlayNote);
server.on("/iutlogo.png", handleImage); // Route pour l'image
server.begin();
}
......