#include #include #include "Tone32.h" #include "LCD_Manage.h" #include "Sound_cam.h" #include int nbCoresESP=0; #define I2C_SDA 4 #define I2C_SCL 5 /** * BUZZER PARAMETERS */ #define BUZZER_CHANNEL 1 // PWM channel -- GPIO1,ADC1_CH1 int buzzerPin = 1; // LED //const int LED_BLEU=2; const int LED_WIFI=7; const int NbTimesBlink=10; void setup() { StartTime = millis(); StartTimeDisplayVersion= millis(); Serial.begin(115200); Serial.println("setup---begin"); Serial.printf("This chip has %d cores\n", ESP.getChipCores()); nbCoresESP=ESP.getChipCores(); //BTSerial.begin(38400); pinMode(LED_WIFI, OUTPUT); pinMode(buzzerPin, OUTPUT); delay(500); digitalWrite(LED_WIFI,LOW); //pinMode(LED_BLEU, OUTPUT); // iterate over the notes of the melody. // Remember, the array is twice the number of notes (notes + durations) for (int thisNote = 0; thisNote < notes * 2; thisNote = thisNote + 2) { // calculates the duration of each note divider = melody[thisNote + 1]; if (divider > 0) { // regular note, just proceed noteDuration = (wholenote) / divider; } else if (divider < 0) { // dotted notes are represented with negative durations!! noteDuration = (wholenote) / abs(divider); noteDuration *= 1.5; // increases the duration in half for dotted notes } // we only play the note for 90% of the duration, leaving 10% as a pause tone(buzzerPin, melody[thisNote], noteDuration*0.9, BUZZER_CHANNEL); // Wait for the specief duration before playing the next note. delay(noteDuration); // stop the waveform generation before the next note. noTone(buzzerPin,BUZZER_CHANNEL); } Serial.println("setup---end"); } void loop (){ }