Lilia Roxana Ghazanfari
Published

Exhibition Popularity and Occupancy

Evaluating the popularity of museum exhibitions and monitoring live occupancy of each exhibition

BeginnerWork in progress23
Exhibition Popularity and Occupancy

Things used in this project

Story

Read more

Schematics

Exhibition Popularity and Occupancy

Counting number of visitors entering an exhibition

Code

Exhibition Popularity and Occupancy

C/C++
Counts number of visitors who enter an exhibition
bool isMotiondetected() {

    int sensorValue = digitalRead(2);

    if(sensorValue == HIGH) {
       return true;
    } else {
       return false;
    }

}

int Num_Entered = 0;



void setup()

{
    Serial.begin(9600);
    pinMode(2,INPUT);


}


void loop()

{

 if(isMotiondetected()) {
    Num_Entered = Num_Entered + 1;
 }


{    
    int sensorValue = digitalRead(2);
   
    Serial.println("sensor value: " + String(sensorValue));
    Serial.println("Number of people who have entered the room today: " + String(Num_Entered));
 
}



}

Credits

Lilia Roxana Ghazanfari
1 project • 0 followers

Comments