Hello, to begin sorry for my English, i'm from France.
I am a beginner in programation
I have a project with 3 firends to do which is very important for my studies.
My part in this project consists to make a program with 2 RFID sensors and 5 RFID tags that will detect if the subject enter or exit the room...
For the moment i am working with button (representing RFID sensors) and LEDS (representing the entry or exit) but the program doesn't work (the leds are going crazy in the simulator :o )
Here is the program :
" int ledPin1 = 5;
int ledPin2 = 6;
int bouton1 = 10;
int bouton2 = 11;
int compteur = 0;
int capteur1= 0;
int capteur2 = 0;
int sens = 0;
int entree = 0;
int sortie = 0;
void setup () {
pinMode(bouton1, INPUT);
pinMode(bouton2, INPUT);
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
}
void loop () {
if (digitalRead(bouton1) == HIGH);
{
capteur1 = 1;
}
if (capteur1 = 1 && bouton2 == HIGH);
{
sens = entree;
}
if (digitalRead(bouton2) == HIGH);
{
capteur2 = 1;
}
if (capteur2 = 1 && bouton1 == HIGH);
{
sens = sortie;
}
if (sens = entree);
{
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, LOW);
}
if (sens = sortie);
{
digitalWrite(ledPin2, HIGH);
digitalWrite(ledPin1, LOW);
}
if (sens = entree);
{
compteur = compteur+1;
}
if (sens = sortie);
{
compteur = compteur-1;
}
} "
If somebody could help me it would be appreciated, thanks.