diff --git a/buzzer/buzzer.ino b/buzzer/buzzer.ino index 7f40dbf..5cc5fcc 100644 --- a/buzzer/buzzer.ino +++ b/buzzer/buzzer.ino @@ -5,7 +5,8 @@ const char* ssid = "Redmi Note 13 Pro 5G"; const char* password = "1234567890"; const char* mqtt_server = "192.168.127.208"; -const char* mqtt_topic = "bouton/etat"; +const char* mqtt_topic = "brainblast/buzzer/pressed/1"; +const char* mqtt_message = "{\"buzzer_id\": 1, \"color\": \"#FF7518\"}"; // Déclaration des broches #define BUTTON_PIN D8 @@ -61,7 +62,7 @@ void loop() { // Vérifier si le bouton est pressé if (digitalRead(BUTTON_PIN) == HIGH) { Serial.println("Bouton pressé, envoi du message..."); - client.publish(mqtt_topic, "Bouton presse"); + client.publish(mqtt_topic, mqtt_message); delay(200); // Anti-rebond pour éviter les publications multiples } -} \ No newline at end of file +} \ No newline at end of file