Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature to rotate sensor #10

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions main/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
#endif
// NOTE!!! THESE CAN BE OVERRIDDEN WITH HARDWARE CODING WITH A GPIO PIN


#if FIS_SENSOR == FIS_AMG8833
//Untested with other sensors so only enabled for AMG8833
#define ROTATETIRE 0 // 0 = default \
// 1 = Rotate the tire (A), making the top edge temps the outside edge temps \
// Can be used with mirror to rotate the other way
#endif

// -- General settings

#define DEVICENAMECODE 7 // DEFAULT is 7
Expand Down
13 changes: 12 additions & 1 deletion main/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ TempSensor tempSensor;
DistSensor distSensor;
uint8_t mirrorTire = 0;
char wheelPos[] = " "; // Wheel position for Tire A
bool rotateTire = false;
char deviceNameSuffix[] = " ";

#if BOARD == BOARD_ESP32_LOLIND32
Expand Down Expand Up @@ -106,6 +107,16 @@ void setup(){
debug("ERROR: Distance sensor for %s not present.\n", wheelPos);
}
#endif

#ifdef ROTATETIRE
// TIRE 1 ROTATED?
if (ROTATETIRE == 1)
{
rotateTire = true;
debug("Temperature sensor orientation for %s is rotated.\n", wheelPos);
}
#endif


debug("Starting temperature sensor for %s...\n", wheelPos);
if (!tempSensor.initialise(FIS_REFRESHRATE, &Wire)) {
Expand Down Expand Up @@ -186,7 +197,7 @@ void loop() {
#if DIST_SENSOR != DIST_NONE
distSensor.measure();
#endif
tempSensor.measure();
tempSensor.measure(rotateTire);

// I2C channel 2
#if FIS_SENSOR2_PRESENT == 1
Expand Down
Loading