-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
184 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// | ||
// FILE: pressure_specific.ino | ||
// AUTHOR: Rob Tillaart | ||
// VERSION: 0.1.0 | ||
// PURPOSE: demo | ||
// DATE: 2021-11-26 | ||
// URL: https://github.com/RobTillaart/pressure | ||
|
||
|
||
#include "pressure.h" | ||
|
||
|
||
pressure P; | ||
|
||
uint32_t start, stop; | ||
float x; | ||
|
||
volatile float value = 1.234; | ||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
Serial.println(__FILE__); | ||
Serial.print("PRESSURE_LIB_VERSION: "); | ||
Serial.println(PRESSURE_LIB_VERSION); | ||
|
||
start = micros(); | ||
for (int i = 0; i < 1000; i++) | ||
{ | ||
P.setPSI(value); | ||
x = P.getMSW(); | ||
} | ||
stop = micros(); | ||
Serial.print("TIME:\t"); | ||
Serial.println(stop - start); | ||
Serial.print("MSW:\t"); | ||
Serial.println(x); | ||
delay(10); | ||
|
||
start = micros(); | ||
for (int i = 0; i < 1000; i++) | ||
{ | ||
x = PSI2MSW(value); | ||
} | ||
stop = micros(); | ||
Serial.print("TIME:\t"); | ||
Serial.println(stop - start); | ||
Serial.print("MSW:\t"); | ||
Serial.println(x); | ||
delay(10); | ||
|
||
start = micros(); | ||
for (int i = 0; i < 1000; i++) | ||
{ | ||
x = value * (PSI2MILLIBAR * MILLIBAR2MSW); | ||
} | ||
stop = micros(); | ||
Serial.print("TIME:\t"); | ||
Serial.println(stop - start); | ||
Serial.print("MSW:\t"); | ||
Serial.println(x); | ||
delay(10); | ||
|
||
} | ||
|
||
void loop() | ||
{ | ||
} | ||
|
||
inline float PSI2MSW(float value) | ||
{ | ||
return value * (PSI2MILLIBAR * MILLIBAR2MSW); | ||
} | ||
|
||
|
||
// -- END OF FILE -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters