You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
374 B
28 lines
374 B
#include <Arduino.h> |
|
#include <Wire.h> |
|
|
|
#include "XGZP.h" |
|
|
|
XGZP sensor; |
|
|
|
float value = 1; |
|
|
|
void setup() { |
|
Serial.begin(9600); |
|
|
|
if(!sensor.begin()){ |
|
Serial.printf("Error initializing Sensor\n Locking up."); |
|
while(1); |
|
} |
|
} |
|
|
|
void loop() { |
|
sensor.read(&value); |
|
|
|
float corrected = 1.368 * value - 6.4; |
|
|
|
Serial.print(corrected); |
|
Serial.println(" PSI"); |
|
|
|
delay(250); |
|
}
|
|
|