Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited title
Link
dda
  • 1.6k
  • 1
  • 12
  • 17

Using Arduino theto detect when a sensor is on and off and display time elapsed

deleted 29 characters in body; edited tags; edited title
Source Link
dda
  • 1.6k
  • 1
  • 12
  • 17

uisng arduino Using Arduino the detect when a sensor is on and off and display time elapsed

I would like to knowknow if iI can use a pressure sensor with an arduinoArduino. The The code will detect when the sensor is on, will start a timer, stop when the sensor is off, and display the time elapsed.

hereHere is the code for the timer:

int main(void) {

 
LARGE_INTEGER frequency;      LARGE_INTEGER frequency; // ticks per second
  LARGE_INTEGER t1,t2;           // ticks
  double elapsedTime;

 
  // get ticks per second
  QueryPerformanceFrequency(&frequency);
 
  // start timer
  QueryPerformanceCounter(&t1);
    
 //the code for sensorwill be written here
 
  QueryPerformanceCounter(&t2);
  elapsedTime = (t2.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
  printf("\nElapsed time : %lf ms.\n", elapsedTime );
 
  return 0;
 
}

uisng arduino the detect when sensor is on and off and display time elapsed

I would like to know if i can use a pressure sensor with an arduino. The code will detect when the sensor is on, will start a timer, stop when the sensor is off, and display the time elapsed.

here is the code for the timer:

int main(void){

 
LARGE_INTEGER frequency;        // ticks per second
LARGE_INTEGER t1,t2;           // ticks
double elapsedTime;

 
// get ticks per second
QueryPerformanceFrequency(&frequency);
 
// start timer
QueryPerformanceCounter(&t1);
    
 //the code for sensorwill be written here
 
QueryPerformanceCounter(&t2);
elapsedTime = (t2.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
printf("\nElapsed time : %lf ms.\n", elapsedTime );
 
return 0;
 
}

Using Arduino the detect when a sensor is on and off and display time elapsed

I would like to know if I can use a pressure sensor with an Arduino. The code will detect when the sensor is on, will start a timer, stop when the sensor is off, and display the time elapsed.

Here is the code for the timer:

int main(void) {
  LARGE_INTEGER frequency; // ticks per second
  LARGE_INTEGER t1,t2; // ticks
  double elapsedTime;
  // get ticks per second
  QueryPerformanceFrequency(&frequency);
  // start timer
  QueryPerformanceCounter(&t1);
  //the code for sensorwill be written here
  QueryPerformanceCounter(&t2);
  elapsedTime = (t2.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
  printf("\nElapsed time : %lf ms.\n", elapsedTime );
  return 0;
}
Bumped by Community user
Bumped by Community user
Bumped by Community user
Post Migrated Here from electronics.stackexchange.com (revisions)
Source Link
faiz
faiz

uisng arduino the detect when sensor is on and off and display time elapsed

I would like to know if i can use a pressure sensor with an arduino. The code will detect when the sensor is on, will start a timer, stop when the sensor is off, and display the time elapsed.

here is the code for the timer:

int main(void){


LARGE_INTEGER frequency;        // ticks per second
LARGE_INTEGER t1,t2;           // ticks
double elapsedTime;


// get ticks per second
QueryPerformanceFrequency(&frequency);

// start timer
QueryPerformanceCounter(&t1);
    
//the code for sensorwill be written here

QueryPerformanceCounter(&t2);
elapsedTime = (t2.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
printf("\nElapsed time : %lf ms.\n", elapsedTime );

return 0;

}