Page 3 sur 3

Re: Montages ESP32 S3 WROOM

Posté : 11 août 2026, 07:25
par likiki
:bienv: :bienv: :bienv:

Re: Montages ESP32 S3 WROOM

Posté : 16 août 2026, 18:26
par Clem68
Exemple N° 7.1

Sonnette sur buzzer
7.1.2.jpg
1 résistance 1 ko
2 résistances 10 ko
1 transistor NPN S8050
1 buzzer actif
7.1.1.jpg
Le sketch:

Code : Tout sélectionner

/**********************************************************************
  Filename    : Doorbell
  Description : Control active buzzer by button.
  Auther      : www.freenove.com
  Modification: 2024/06/18
**********************************************************************/
#define PIN_BUZZER 14
#define PIN_BUTTON 21

void setup() {
  pinMode(PIN_BUZZER, OUTPUT);
  pinMode(PIN_BUTTON, INPUT);
}

void loop() {
  if (digitalRead(PIN_BUTTON) == LOW) {
    digitalWrite(PIN_BUZZER,HIGH);
  }else{
    digitalWrite(PIN_BUZZER,LOW);
  }
}


Hors sujet:

Vu que je suis restreint au niveau bricolage cause chaleur, je me suis fait un petit forum sur forumactif, histoire de m'occuper. Je sais que je ne dois pas penser à avoir des membres, mais bon, ça occupe.... :siffle:
https://lecoindespassions.forumactif.com/

@+

Re: Montages ESP32 S3 WROOM

Posté : 16 août 2026, 19:29
par Amigorl
Wroom... Ça roule.... :PetitPoucejpg:

Re: Montages ESP32 S3 WROOM

Posté : 16 août 2026, 20:14
par likiki
:cooooool: :cooooool:

Re: Montages ESP32 S3 WROOM

Posté : 16 août 2026, 20:28
par C2Vues-BricoTrain
:bienv: :bienv:

:PetitPoucejpg: :PetitPoucejpg: :PetitPoucejpg:

C'est bien de faire ton forum sur ce que tu fais, j'espère que tu trouveras ton public...
(Même si je n'y ai pas laissé de commentaire, j'ai quand même fait le détour pour aller voir :mdr1: )

Re: Montages ESP32 S3 WROOM

Posté : 17 août 2026, 10:04
par patrice_b
:bienv: :bienv:

Re: Montages ESP32 S3 WROOM

Posté : 18 août 2026, 11:12
par Clem68
:merciiii: pour vos retours c’est sympa.

Fernando
C'est bien de faire ton forum sur ce que tu fais, j'espère que tu trouveras ton public...
Comme je l’ai dit ça m’occupe un peu, mais je ne me fait pas trop d’illusion quant au public… les forums n’ont plus la cote face aux réseaux sociaux. Sinon mon forum est opérationnel et actif :siffle:

@+

Re: Montages ESP32 S3 WROOM

Posté : 18 août 2026, 21:45
par Clem68
Exercice: N° 7.2

Alarme sur Buzzer

Même câblage que précédemment sauf que le Buzzer actif est remplacer par un Buzzer passif

Le sketch:

Code : Tout sélectionner

/**********************************************************************
  Filename    : Alertor
  Description : Using software pwm to control passive buzzer by button.
  Auther      : www.freenove.com
  Modification: 2024/06/18
**********************************************************************/
#define BUZZER_PIN     14
#define PIN_BUTTON     21
hw_timer_t * timer = NULL;

bool isAlerting = false;

void IRAM_ATTR onTimer() {
  digitalWrite(BUZZER_PIN, !digitalRead(BUZZER_PIN));
}

void setup() {
  pinMode(PIN_BUTTON, INPUT);
  pinMode(BUZZER_PIN, OUTPUT);
  // Set the timer frequency to 1MHz.(see ESP32 Technical Reference Manual for more info).
  timer = timerBegin(1000000);
  // Attach onTimer function to our timer.
  timerAttachInterrupt(timer, &onTimer);
}
void loop() {
  if (digitalRead(PIN_BUTTON) == LOW) {
    if (!isAlerting) {
      isAlerting = true;
      // Set alarm, 1ms, repeat, auto-reload value.
      timerAlarm(timer, 1000, true, 0);
      // Start an alarm
      timerStart(timer);
    }
    alert();
  } else {
    if (isAlerting) {
      isAlerting = false;
      timerStop(timer);
      digitalWrite(BUZZER_PIN, LOW);
    }
  }
}

void alert() {
  float sinVal;
  int toneVal;
  for (int x = 0; x < 360; x += 1) {
    sinVal = sin(x * (PI / 180));
    toneVal = 2000 + sinVal * 500;
    timerAlarm(timer, 500000 / toneVal, true, 0);
    delay(1);
  }
}


@+

Re: Montages ESP32 S3 WROOM

Posté : 19 août 2026, 10:17
par patrice_b
:merciiii: :merciiii: :bienv: