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;
}