Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Béta code start&stop

145 views

Published on

code microcontroleur

Published in: Engineering
  • accessibility Books Library allowing access to top content, including thousands of title from favorite author, plus the ability to read or download a huge selection of books for your pc or smartphone within minutes.........ACCESS WEBSITE Over for All Ebooks ..... (Unlimited) ......................................................................................................................... Download FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THI5 BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Béta code start&stop

  1. 1. //Start&stop by djeek //Probleme … Pour le moment les boutons ne sont pas à préssoir, l’état du bouton doit être enregistré // Probleme, il n’est pas possible d’appeler la fonction loop, il faut créer une nouvelle foncion contenu dans la loop pour pouvoir en sortir. // la loop peut etre utilisé en pré raglage du temps #define VERT 0 #define ORANGE 1 #define ROUGE 2 //numéro des broches utilisées const int btn_BASE1= 2; const int btn_BASE2 = 3; const int leds[3] = {11,12,13}; //tableau de 3 éléments contenant les numéros de broches des LED void setup() { //réglage des entrées/sorties //les entrées (2 boutons) pinMode(btn_BASE1, INPUT); pinMode(btn_BASE2, INPUT); //on définit les broches, où les LED sont connectées, en sortie pinMode(led_vert, OUTPUT); pinMode(led_rouge, OUTPUT); pinMode(led_orange, OUTPUT); //On éteint les LED digitalWrite(led_vert, HIGH); digitalWrite(led_orange, HIGH); digitalWrite(led_rouge, LOW); } void loop() { //on regarde si le bouton BASE1 est appuyé if(digitalRead(btn_BASE1) == LOW) { digitalWrite(led_rouge, HIGH); digitalWrite(led_orange, LOW); } //puis on continu en vérifiant si le bouton BASE2 est appuyé if(digitalRead(btn_BASE2) == LOW) { digitalWrite(led_rouge, HIGH); digitalWrite(led_orange, LOW); } // finalement on regarde si les bouton BASE1 Et BASE2 sont appuyés if(digitalRead(btn_BASE1) == LOW && digitalRead(btn_BASE2) == LOW) { //si oui, on émet l'alerte en appelant la fonction prévue à cet effet lancement(); } }
  2. 2. //le lancement de la partie void lancement(void) { digitalWrite(led_orange, LOW); digitalWrite(led_rouge, HIGH); delay(1000); if(digitalRead(btn_BASE1) == LOW || digitalRead(btn_BASE2) == LOW) { //si oui, le départ est annulé loop() } //Le compte à rebours de 5 sec commence digitalWrite(led_orange, HIGH); delay(1000); if(digitalRead(btn_BASE1) == LOW || digitalRead(btn_BASE2) == LOW) { //si oui, le départ est annulé loop() } digitalWrite(led_orange, LOW); delay(1000); if(digitalRead(btn_BASE1) == LOW || digitalRead(btn_BASE2) == LOW) { //si oui, le départ est annulé loop() } digitalWrite(led_orange, HIGH); delay(1000); if(digitalRead(btn_BASE1) == LOW || digitalRead(btn_BASE2) == LOW) { //si oui, le départ est annulé loop() } digitalWrite(led_orange, LOW); delay(1000); digitalWrite(led_orange, HIGH); if(digitalRead(btn_BASE1) == LOW || digitalRead(btn_BASE2) == LOW) { //si oui, le départ est annulé loop() }
  3. 3. //coup de sirène et feu vert digitalWrite(led_vert, LOW); digitalWrite(led_orange, HIGH); delay(3000); digitalWrite(led_vert, HIGH); digitalWrite(led_orange, HIGH); delay(5000); for(int compteur = 300; compteur >0; compteur--) { delay(500); if(digitalRead(btn_BASE1) == LOW || digitalRead(btn_BASE2) == LOW ) { //si oui, le départ est annulé digitalWrite(led_vert, LOW); delay(3000); digitalWrite(led_vert, HIGH); loop() } delay(500) ; } digitalWrite(led_vert, LOW); delay(3000); digitalWrite(led_vert, HIGH); }

×