Pc Lap Counter
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Pc Lap Counter

Logiciel de comptage
 
HomeHome  SearchSearch  Latest imagesLatest images  RegisterRegister  Log in  

 

 Feux de Départ en quelques lignes + Y Flag clignotant

Go down 
3 posters
AuthorMessage
Slotrain




Number of posts : 11
Localisation : Saint Caradec - Fr
Registration date : 2022-06-26

Feux de Départ en quelques lignes + Y Flag clignotant Empty
PostSubject: Feux de Départ en quelques lignes + Y Flag clignotant   Feux de Départ en quelques lignes + Y Flag clignotant Empty14/5/2023, 12:04

sunny Bonjour à tous,
Ma petite contribution !!!
En quelques lignes, les feux de départ

Amusez vous bien  Wink


const int LedSL[] = {2,3,4,5,6,7,8,9}; // Starting Lights x 8
long delaiReception = 10; //
String leCode, laChaine;
int ledDecompte, Etat, YFlag;

void setup()
{
 Serial.begin(9600); // Communication PC
 Serial.println("Nano_Feux de Départ");

 for (int i = 2 ; i <= 9 ; i++)
   {
     pinMode( i, OUTPUT); // Définit les broches 2 à 9 comme sorties
     digitalWrite(i, LOW); // éteint les sorties
   }
}

void loop()
{
 //             Réception_PC  Serial
 if ( Serial.available()>0 )
     {
       String debut = Serial.readStringUntil('[');
       { laChaine = Serial.readStringUntil(']'); }
     }
 
// si YFlag = 1, fait clignoter la led jaune
      if ( YFlag == 1)  { digitalWrite(LedSL[7], millis() / 500 % 2 );}    

 if (laChaine != "")
  {
     leCode = laChaine.substring( 0, 2); // 'SL'021
     Etat = laChaine.substring( 4, 5).toInt(); // SL02'1'
     ledDecompte = laChaine.substring( 3, 4).toInt(); // SL0'2'1
     laChaine = "";

     if (leCode == "SL")  
      {
        {
          digitalWrite(LedSL[ledDecompte - 1], Etat);
          if (ledDecompte == Cool {  YFlag = Etat; } // if (ledDecompte == huit en chiffre) {  YFlag = Etat; }
        }
        ledDecompte = "";
      }
     
   }
}


Last edited by Slotrain on 8/6/2023, 09:02; edited 2 times in total
Back to top Go down
http://www.slotrain.kingeshop.com/
guy

guy


Number of posts : 2296
Localisation : Belgique
Registration date : 2006-01-25

Feux de Départ en quelques lignes + Y Flag clignotant Empty
PostSubject: Re: Feux de Départ en quelques lignes + Y Flag clignotant   Feux de Départ en quelques lignes + Y Flag clignotant Empty15/5/2023, 22:59

Merci pour votre contribution ;-)

Back to top Go down
http://www.pclapcounter.be
ludikenergie




Number of posts : 1
Registration date : 2024-01-24

Feux de Départ en quelques lignes + Y Flag clignotant Empty
PostSubject: Re: Feux de Départ en quelques lignes + Y Flag clignotant   Feux de Départ en quelques lignes + Y Flag clignotant Empty24/1/2024, 13:19

Bonjour, quel leds utilisez vous ?

Merci
Back to top Go down
Slotrain




Number of posts : 11
Localisation : Saint Caradec - Fr
Registration date : 2022-06-26

Feux de Départ en quelques lignes + Y Flag clignotant Empty
PostSubject: Re: Feux de Départ en quelques lignes + Y Flag clignotant   Feux de Départ en quelques lignes + Y Flag clignotant Empty24/1/2024, 17:18

Bonjour ludikenergie,
N'importe quelle led 3 ou 5mm
Une par sortie avec chacune une résistance de 470 Ohms
Bon bricolage
Back to top Go down
http://www.slotrain.kingeshop.com/
Sponsored content





Feux de Départ en quelques lignes + Y Flag clignotant Empty
PostSubject: Re: Feux de Départ en quelques lignes + Y Flag clignotant   Feux de Départ en quelques lignes + Y Flag clignotant Empty

Back to top Go down
 
Feux de Départ en quelques lignes + Y Flag clignotant
Back to top 
Page 1 of 1
 Similar topics
-
» Video - showing how to change zoom display
» scalex digit connection feux de depart start gantry + pc lap c
» BUG ? Problème de feux de départ avec Phidget et Carrera CU30352 [fixed 5.39c]
» Quelques infos,quelques propositions
» Évolution fichier XML/HTML - Couleurs lignes tableau

Permissions in this forum:You cannot reply to topics in this forum
Pc Lap Counter :: Hardware :: Arduino-
Jump to: