s

Dependencies:   Afficheled centrale buzzer

Committer:
schnf30
Date:
Wed Dec 16 09:14:20 2020 +0000
Revision:
1:47f761a84ea2
Parent:
0:be6818d29dfc
dfs

Who changed what in which revision?

UserRevisionLine numberNew contents of line
schnf30 0:be6818d29dfc 1 /* Mon programme centrale alarme
schnf30 0:be6818d29dfc 2 V1-0
schnf30 0:be6818d29dfc 3 Le 03-12-2020
schnf30 0:be6818d29dfc 4 Par François SCHNEIDER */
schnf30 0:be6818d29dfc 5
schnf30 0:be6818d29dfc 6 // On ajoute entree 1
schnf30 0:be6818d29dfc 7 #include "mbed.h"
schnf30 0:be6818d29dfc 8 #include "platform/mbed_thread.h"
schnf30 0:be6818d29dfc 9 #include "etat.h"
schnf30 0:be6818d29dfc 10 #include "afficheled.h"
schnf30 0:be6818d29dfc 11 #include "centrale.h"
schnf30 0:be6818d29dfc 12 #include "buzzer.h"
schnf30 0:be6818d29dfc 13
schnf30 0:be6818d29dfc 14 // Blinking rate in milliseconds
schnf30 0:be6818d29dfc 15 #define BLINKING_RATE_MS 500
schnf30 0:be6818d29dfc 16 // Serial pc(USBTX,USBRX);
schnf30 0:be6818d29dfc 17 AnalogIn pot1 (A0);
schnf30 0:be6818d29dfc 18 AnalogIn pot2 (A1);
schnf30 0:be6818d29dfc 19
schnf30 0:be6818d29dfc 20 int main()
schnf30 0:be6818d29dfc 21 {
schnf30 0:be6818d29dfc 22 float Entree1;
schnf30 0:be6818d29dfc 23 int EtatEntree1;
schnf30 0:be6818d29dfc 24 StartBuzzer();
schnf30 0:be6818d29dfc 25 while (true) {
schnf30 0:be6818d29dfc 26 Entree1 = 5.0*pot1.read(); // on lit entree 1
schnf30 0:be6818d29dfc 27 EtatEntree1 = TraitEntree(Entree1); // on traite entree 1
schnf30 0:be6818d29dfc 28 SetEtatLed(EtatEntree1);
schnf30 0:be6818d29dfc 29 SetEtatBuzzer(EtatEntree1);
schnf30 0:be6818d29dfc 30 }
schnf30 0:be6818d29dfc 31 }