|
|
|
|
|
|
|
|
Status originStatus; |
|
|
Status originStatus; |
|
|
String oldStatus = ""; |
|
|
String oldStatus = ""; |
|
|
|
|
|
|
|
|
|
|
|
//********************* Rotary test ************** |
|
|
|
|
|
|
|
|
|
|
|
long TimeOfLastDebounce = 0; |
|
|
|
|
|
long DelayofDebounce = 5; |
|
|
|
|
|
|
|
|
|
|
|
// Store previous Pins state |
|
|
|
|
|
int PreviousCLK; |
|
|
|
|
|
int PreviousDATA; |
|
|
|
|
|
|
|
|
|
|
|
int displaycounter = 0; // Store current counter value |
|
|
|
|
|
volatile boolean TurnDetected; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void printStatus(String actualStatus) { |
|
|
void printStatus(String actualStatus) { |
|
|
if (!oldStatus.equals(actualStatus)) { |
|
|
if (!oldStatus.equals(actualStatus)) { |
|
|
Serial.println(actualStatus); |
|
|
Serial.println(actualStatus); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (Router_Setup.isToolChangOnPowerOn()) { |
|
|
if (Router_Setup.isToolChangOnPowerOn()) { |
|
|
actualStatus = TOOL_CHANGE; |
|
|
|
|
|
|
|
|
SetActualStatus(TOOL_CHANGE); |
|
|
} else { |
|
|
} else { |
|
|
actualStatus = IDLE; |
|
|
|
|
|
|
|
|
SetActualStatus(IDLE); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//********************** |
|
|
//********************** |
|
|
void setup() { |
|
|
void setup() { |
|
|
|
|
|
|
|
|
actualStatus = INITIALIZATION; |
|
|
|
|
|
|
|
|
SetActualStatus(INITIALIZATION); |
|
|
|
|
|
|
|
|
Wire.begin(SDA, SCX); |
|
|
Wire.begin(SDA, SCX); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pinMode(GreenBtn_Pin, INPUT); |
|
|
pinMode(GreenBtn_Pin, INPUT); |
|
|
pinMode(RedBtn_Pin, INPUT); |
|
|
pinMode(RedBtn_Pin, INPUT); |
|
|
pinMode(BlueBtn_Pin, INPUT); |
|
|
pinMode(BlueBtn_Pin, INPUT); |
|
|
pinMode(RotEnc_Switch_Pin, INPUT); |
|
|
|
|
|
pinMode(RotEnc_Clk_Pin, INPUT); |
|
|
|
|
|
pinMode(RotEnc_Dta_Pin, INPUT); |
|
|
|
|
|
|
|
|
pinMode(RotEnc_Switch_Pin, INPUT_PULLUP); |
|
|
|
|
|
// pinMode(RotEnc_Clk_Pin, INPUT_PULLUP); |
|
|
|
|
|
// pinMode(RotEnc_Dta_Pin, INPUT_PULLUP); |
|
|
pinMode(LIMIT_SWITCH, INPUT); |
|
|
pinMode(LIMIT_SWITCH, INPUT); |
|
|
|
|
|
|
|
|
RedButton.setDebounceTime(50); // set debounce time to 50 millis |
|
|
RedButton.setDebounceTime(50); // set debounce time to 50 millis |
|
|
|
|
|
|
|
|
RotaryControler.setDebounceTime(50); |
|
|
RotaryControler.setDebounceTime(50); |
|
|
|
|
|
|
|
|
delay(1500); |
|
|
delay(1500); |
|
|
|
|
|
Display.setRefreshScreen(); |
|
|
Display.showBrand(); |
|
|
Display.showBrand(); |
|
|
delay(1500); |
|
|
delay(1500); |
|
|
|
|
|
Display.setRefreshScreen(); |
|
|
Initialize(); |
|
|
Initialize(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
originStatus = TOOL_CHANGE; |
|
|
originStatus = TOOL_CHANGE; |
|
|
if (intermediateState == 0) { |
|
|
if (intermediateState == 0) { |
|
|
Router_Elevator.moveToUpperLimitSwitch(); |
|
|
Router_Elevator.moveToUpperLimitSwitch(); |
|
|
actualStatus = MOVING_ELEVATOR; |
|
|
|
|
|
|
|
|
SetActualStatus(MOVING_ELEVATOR); |
|
|
intermediateState = 1; |
|
|
intermediateState = 1; |
|
|
} else if (intermediateState == 1) { |
|
|
} else if (intermediateState == 1) { |
|
|
if (RotaryControler.isSwitchLongPressed()) { |
|
|
if (RotaryControler.isSwitchLongPressed()) { |
|
|
actualStatus = CONFIGURATION; |
|
|
|
|
|
|
|
|
SetActualStatus(CONFIGURATION); |
|
|
intermediateState = 0; |
|
|
intermediateState = 0; |
|
|
} else if (BlueButton.isPressed()) { |
|
|
} else if (BlueButton.isPressed()) { |
|
|
actualStatus = IDLE; |
|
|
|
|
|
|
|
|
SetActualStatus(IDLE); |
|
|
intermediateState = 0; |
|
|
intermediateState = 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Router_Setup.onRotaryControlerSwitch(); |
|
|
Router_Setup.onRotaryControlerSwitch(); |
|
|
} else if (RotaryControler.isSwitchLongPressed()) { |
|
|
} else if (RotaryControler.isSwitchLongPressed()) { |
|
|
Router_Setup.onRotaryControlerLongSwitch(); |
|
|
Router_Setup.onRotaryControlerLongSwitch(); |
|
|
actualStatus = INITIALIZATION; |
|
|
|
|
|
|
|
|
SetActualStatus(INITIALIZATION); |
|
|
} else if (BlueButton.isPressed()) { |
|
|
} else if (BlueButton.isPressed()) { |
|
|
actualStatus = IDLE; |
|
|
|
|
|
|
|
|
SetActualStatus(IDLE); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printStatus("NULLING"); |
|
|
printStatus("NULLING"); |
|
|
if (RedButton.isPressed()) { |
|
|
if (RedButton.isPressed()) { |
|
|
Router_Elevator.setZeroPosition(); |
|
|
Router_Elevator.setZeroPosition(); |
|
|
actualStatus = IDLE; |
|
|
|
|
|
|
|
|
SetActualStatus(IDLE); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printStatus("NULLING_TLS,0"); |
|
|
printStatus("NULLING_TLS,0"); |
|
|
//Move elevator to lowest point (lower limit switch triggers) |
|
|
//Move elevator to lowest point (lower limit switch triggers) |
|
|
Router_Elevator.moveToLowerLimitSwitch(); |
|
|
Router_Elevator.moveToLowerLimitSwitch(); |
|
|
actualStatus = MOVING_ELEVATOR; |
|
|
|
|
|
|
|
|
SetActualStatus(MOVING_ELEVATOR); |
|
|
intermediateState = 1; |
|
|
intermediateState = 1; |
|
|
} else if (intermediateState == 1) { |
|
|
} else if (intermediateState == 1) { |
|
|
printStatus("NULLING_TLS,1"); |
|
|
printStatus("NULLING_TLS,1"); |
|
|
if (RedButton.isPressed()) { |
|
|
if (RedButton.isPressed()) { |
|
|
//Move elevator until it touch the TLS (WLS_PIN goes HIGH) |
|
|
//Move elevator until it touch the TLS (WLS_PIN goes HIGH) |
|
|
Router_Elevator.moveToUpperLimitSwitch(); |
|
|
Router_Elevator.moveToUpperLimitSwitch(); |
|
|
actualStatus = MOVING_ELEVATOR; |
|
|
|
|
|
|
|
|
SetActualStatus(MOVING_ELEVATOR); |
|
|
intermediateState = 2; |
|
|
intermediateState = 2; |
|
|
} |
|
|
} |
|
|
} else if (intermediateState == 2) { |
|
|
} else if (intermediateState == 2) { |
|
|
|
|
|
|
|
|
Router_Elevator.clearLimitSwitch(); |
|
|
Router_Elevator.clearLimitSwitch(); |
|
|
Router_Elevator.moveRelativeInMillimeters(Router_Setup.getToolLenghtSensorHeight() * MOVE_DOWNWARD); |
|
|
Router_Elevator.moveRelativeInMillimeters(Router_Setup.getToolLenghtSensorHeight() * MOVE_DOWNWARD); |
|
|
Serial.println(String(Router_Setup.getToolLenghtSensorHeight() * MOVE_DOWNWARD, 2)); |
|
|
Serial.println(String(Router_Setup.getToolLenghtSensorHeight() * MOVE_DOWNWARD, 2)); |
|
|
actualStatus = MOVING_ELEVATOR; |
|
|
|
|
|
|
|
|
SetActualStatus(MOVING_ELEVATOR); |
|
|
intermediateState = 3; |
|
|
intermediateState = 3; |
|
|
} else { // nullingTLS_intermediateState is 3 |
|
|
} else { // nullingTLS_intermediateState is 3 |
|
|
printStatus("NULLING_TLS,3"); |
|
|
printStatus("NULLING_TLS,3"); |
|
|
//Set the 0-Position as actual position |
|
|
//Set the 0-Position as actual position |
|
|
Router_Elevator.setZeroPosition(); |
|
|
Router_Elevator.setZeroPosition(); |
|
|
actualStatus = IDLE; |
|
|
|
|
|
|
|
|
SetActualStatus(IDLE); |
|
|
intermediateState = 0; |
|
|
intermediateState = 0; |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
printStatus("IDLE"); |
|
|
printStatus("IDLE"); |
|
|
if (RedButton.isLongPressed()) { |
|
|
if (RedButton.isLongPressed()) { |
|
|
if (WlsDetect.isConnected()) { |
|
|
if (WlsDetect.isConnected()) { |
|
|
actualStatus = NULLING_TLS; |
|
|
|
|
|
|
|
|
SetActualStatus(NULLING_TLS); |
|
|
} else { |
|
|
} else { |
|
|
actualStatus = NULLING; |
|
|
|
|
|
|
|
|
SetActualStatus(NULLING); |
|
|
} |
|
|
} |
|
|
} else if (BlueButton.isLongPressed()) { |
|
|
} else if (BlueButton.isLongPressed()) { |
|
|
actualStatus = TOOL_CHANGE; |
|
|
|
|
|
|
|
|
SetActualStatus(TOOL_CHANGE); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printStatus("MOVING_ELEVATOR"); |
|
|
printStatus("MOVING_ELEVATOR"); |
|
|
if (Router_Elevator.isLimitSwitchTriggerd()) { |
|
|
if (Router_Elevator.isLimitSwitchTriggerd()) { |
|
|
delay(200); |
|
|
delay(200); |
|
|
actualStatus = RELEASE_SWITCH; |
|
|
|
|
|
|
|
|
SetActualStatus(RELEASE_SWITCH); |
|
|
} else { // limitSwitchState is HIGH |
|
|
} else { // limitSwitchState is HIGH |
|
|
if (Router_Elevator.isTargetPositionReached()) { |
|
|
if (Router_Elevator.isTargetPositionReached()) { |
|
|
actualStatus = originStatus; |
|
|
|
|
|
|
|
|
SetActualStatus(originStatus); |
|
|
delay(200); |
|
|
delay(200); |
|
|
} else if (Router_Elevator.isWLSTriggerd()) { |
|
|
} else if (Router_Elevator.isWLSTriggerd()) { |
|
|
actualStatus = originStatus; |
|
|
|
|
|
|
|
|
SetActualStatus(originStatus); |
|
|
delay(200); |
|
|
delay(200); |
|
|
} |
|
|
} |
|
|
Router_Elevator.clearLimitSwitch(); |
|
|
Router_Elevator.clearLimitSwitch(); |
|
|
|
|
|
|
|
|
if (Router_Elevator.isLimitSwitchTriggerd()) { |
|
|
if (Router_Elevator.isLimitSwitchTriggerd()) { |
|
|
Router_Elevator.tryReleaseLimitSwitch(); |
|
|
Router_Elevator.tryReleaseLimitSwitch(); |
|
|
} else { |
|
|
} else { |
|
|
actualStatus = originStatus; |
|
|
|
|
|
|
|
|
SetActualStatus(originStatus); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
default: |
|
|
default: |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//*********************** OLD EXAMPLE AND EXPERIMENTAL CODE ************************************ |
|
|
|
|
|
|
|
|
|
|
|
// if (WlsDetect.isPlugged()) { |
|
|
|
|
|
// Serial.println("The WLS was connected"); |
|
|
|
|
|
// } else if (WlsDetect.isUnplugged()) { |
|
|
|
|
|
// Serial.println("The WLS was disconnected"); |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// if (WlsDetect.getStateRaw() == HIGH) { |
|
|
|
|
|
// if (Wls.isPlugged()) { |
|
|
|
|
|
// Serial.println("The Tool is away from WLS"); |
|
|
|
|
|
// } else if (Wls.isUnplugged()) { |
|
|
|
|
|
// Serial.println("The Tool touched the WLS"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// if (RedButton.isPressed()) { |
|
|
|
|
|
// Serial.println("Red button was pressed"); |
|
|
|
|
|
// digitalWrite(led_gpio, HIGH); |
|
|
|
|
|
// Serial.print("Limit Switch: "); |
|
|
|
|
|
// Serial.println(digitalRead(LIMIT_SWITCH) ? "HIGH" : "LOW"); |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// if (RedButton.isLongPressed()) { |
|
|
|
|
|
// Serial.println("Red button was long pressed"); |
|
|
|
|
|
// digitalWrite(led_gpio, LOW); |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// bool greenPressed = GreenButton.isPressed(); |
|
|
|
|
|
// bool bluePressed = BlueButton.isPressed(); |
|
|
|
|
|
// |
|
|
|
|
|
// if (GreenButton.isPressing() && BlueButton.isPressing()) { |
|
|
|
|
|
// Serial.println("Blue and green button were simultaneous pressed"); |
|
|
|
|
|
// } else if (greenPressed) { |
|
|
|
|
|
// Serial.println("Green button was pressed"); |
|
|
|
|
|
// } else if (bluePressed) { |
|
|
|
|
|
// Serial.println("Blue button was pressed"); |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// if (RotarySwitch.isPressed()) { |
|
|
|
|
|
// Serial.println("Rotary switch was pressed"); |
|
|
|
|
|
// } |
|
|
|
|
|
// if (RotarySwitch.isLongPressed()) { |
|
|
|
|
|
// Serial.println("Rotary switch long was pressed"); |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// static int pos = 0; |
|
|
|
|
|
//RotaryControler.tick(); |
|
|
|
|
|
//int newPos = RotaryControler.getPosition(); |
|
|
|
|
|
// if (pos != newPos) { |
|
|
|
|
|
// Serial.print("pos:"); |
|
|
|
|
|
// Serial.print(newPos); |
|
|
|
|
|
// Serial.print(" dir:"); |
|
|
|
|
|
// Serial.println((int) (RotaryControler.getDirection())); |
|
|
|
|
|
// pos = newPos; |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// if (limitSwitchState == LOW) { |
|
|
|
|
|
// stepper.setLimitSwitchActive(stepper.LIMIT_SWITCH_COMBINED_BEGIN_AND_END); // this will cause to stop any motion that is currently going on and block further movement in the same direction as long as the switch is agtive |
|
|
|
|
|
// } else { |
|
|
|
|
|
// stepper.clearLimitSwitchActive(); // clear the limit switch flag to allow movement in both directions again |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// if (limitSwitchState == HIGH && stepper.getDistanceToTargetSigned() == 0) { |
|
|
|
|
|
// delay(100); |
|
|
|
|
|
// previousDirection *= -1; |
|
|
|
|
|
// long relativeTargetPosition = DISTANCE_TO_TRAVEL_IN_STEPS * previousDirection; |
|
|
|
|
|
// Serial.printf("Moving stepper by %ld steps\n", relativeTargetPosition); |
|
|
|
|
|
// stepper.setTargetPositionRelativeInSteps(relativeTargetPosition); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//void testdrawchar(void) { |
|
|
|
|
|
// OLED.clearDisplay(); |
|
|
|
|
|
// |
|
|
|
|
|
// OLED.setTextSize(1); // Normal 1:1 pixel scale |
|
|
|
|
|
// OLED.setTextColor(SSD1306_WHITE); // Draw white text |
|
|
|
|
|
// OLED.setCursor(0, 0); // Start at top-left corner |
|
|
|
|
|
// OLED.cp437(true); // Use full 256 char 'Code Page 437' font |
|
|
|
|
|
// |
|
|
|
|
|
// // Not all the characters will fit on the Display. This is normal. |
|
|
|
|
|
// // Library will draw what it can and the rest will be clipped. |
|
|
|
|
|
// for (int16_t i = 0; i < 256; i++) { |
|
|
|
|
|
// if (i == '\n') |
|
|
|
|
|
// OLED.write(' '); |
|
|
|
|
|
// else |
|
|
|
|
|
// OLED.write(i); |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// OLED.display(); |
|
|
|
|
|
// delay(2000); |
|
|
|
|
|
//} |
|
|
|
|
|
// |
|
|
|
|
|
//void testdrawstyles(void) { |
|
|
|
|
|
// OLED.clearDisplay(); |
|
|
|
|
|
|
|
|
|
|
|
// Display.setFont(&Rubik_Regular8pt7b); |
|
|
|
|
|
// Display.setTextSize(1); // Normal 1:1 pixel scale |
|
|
|
|
|
// Display.setTextColor(SSD1306_WHITE); // Draw white text |
|
|
|
|
|
// Display.setCursor(0, 8); // Start at top-left corner |
|
|
|
|
|
// Display.println(F("Hello, world!")); |
|
|
|
|
|
// |
|
|
|
|
|
// Display.setFont(&Rubik_Regular12pt7b); |
|
|
|
|
|
// Display.setTextSize(1); // Normal 1:1 pixel scale |
|
|
|
|
|
// Display.setTextColor(SSD1306_WHITE); // Draw white text |
|
|
|
|
|
// Display.setCursor(0, 24); // Start at top-left corner |
|
|
|
|
|
// Display.println(F("Hello, world!")); |
|
|
|
|
|
|
|
|
|
|
|
// Display.drawRect(0, 15, 128, 13, SSD1306_WHITE); |
|
|
|
|
|
|
|
|
|
|
|
// Display.setFont(&Rubik_Regular24pt7b); |
|
|
|
|
|
// Display.setTextSize(1); // Normal 1:1 pixel scale |
|
|
|
|
|
// Display.setTextColor(SSD1306_WHITE); // Draw white text |
|
|
|
|
|
// Display.setCursor(0, 55); // Start at top-left corner |
|
|
|
|
|
// Display.println(F("Hello, world!")); |
|
|
|
|
|
// |
|
|
|
|
|
// Display.display(); |
|
|
|
|
|
// delay(2000); |
|
|
|
|
|
// |
|
|
|
|
|
// Display.clearDisplay(); |
|
|
|
|
|
|
|
|
|
|
|
// char decimals[3]; |
|
|
|
|
|
// uint16_t w = 0, h = 0; |
|
|
|
|
|
// for (int i = 0; i <= 99; i++) { |
|
|
|
|
|
// OLED.clearDisplay(); |
|
|
|
|
|
// OLED.drawRect(0, 0, 128, 64, SSD1306_WHITE); |
|
|
|
|
|
// OLED.setFont(&titillium_web_semibold30pt7b); |
|
|
|
|
|
// OLED.setTextSize(1); // Normal 1:1 pixel scale |
|
|
|
|
|
// OLED.setTextColor(SSD1306_WHITE); // Draw white text |
|
|
|
|
|
// sprintf(decimals, "%02d", i); |
|
|
|
|
|
// if (i < 33) { |
|
|
|
|
|
// calculateWH("99.", w, h); |
|
|
|
|
|
// OLED.setCursor((SCREEN_WIDTH / 2 - 1) - w, SCREEN_HEIGHT / 2 + h / 2); |
|
|
|
|
|
// OLED.print("99."); |
|
|
|
|
|
// } else if (i >= 33 && i < 66) { |
|
|
|
|
|
// calculateWH("01.", w, h); |
|
|
|
|
|
// OLED.setCursor((SCREEN_WIDTH / 2 - 1) - w, SCREEN_HEIGHT / 2 + h / 2); |
|
|
|
|
|
// OLED.print("01."); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// calculateWH("55.", w, h); |
|
|
|
|
|
// OLED.setCursor((SCREEN_WIDTH / 2 - 1) - w, SCREEN_HEIGHT / 2 + h / 2); |
|
|
|
|
|
// OLED.print("55."); |
|
|
|
|
|
// } |
|
|
|
|
|
// OLED.println(decimals); |
|
|
|
|
|
// OLED.display(); |
|
|
|
|
|
// delay(100); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// Display.setFont(&Rubik_Regular30pt7b); |
|
|
|
|
|
// Display.setTextSize(1); // Normal 1:1 pixel scale |
|
|
|
|
|
// Display.setTextColor(SSD1306_WHITE); // Draw white text |
|
|
|
|
|
// Display.setCursor(0, 55); // Start at top-left corner |
|
|
|
|
|
// Display.println(F("99.99")); |
|
|
|
|
|
// |
|
|
|
|
|
// Display.display(); |
|
|
|
|
|
// delay(1000); |
|
|
|
|
|
// |
|
|
|
|
|
// Display.clearDisplay(); |
|
|
|
|
|
// |
|
|
|
|
|
// Display.setFont(&Rubik_Regular30pt7b); |
|
|
|
|
|
// Display.setTextSize(1); // Normal 1:1 pixel scale |
|
|
|
|
|
// Display.setTextColor(SSD1306_WHITE); // Draw white text |
|
|
|
|
|
// Display.setCursor(0, 55); // Start at top-left corner |
|
|
|
|
|
// Display.println(F("01.11")); |
|
|
|
|
|
|
|
|
|
|
|
// Display.setTextColor(SSD1306_BLACK, SSD1306_WHITE); // Draw 'inverse' text |
|
|
|
|
|
// Display.println("3.141592"); |
|
|
|
|
|
// |
|
|
|
|
|
// Display.setTextSize(2); // Draw 2X-scale text |
|
|
|
|
|
// Display.setTextColor(SSD1306_WHITE); |
|
|
|
|
|
// Display.print(F("0x")); |
|
|
|
|
|
// Display.println(0xDEADBEEF, HEX); |
|
|
|
|
|
// |
|
|
|
|
|
// OLED.display(); |
|
|
|
|
|
// delay(2000); |
|
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
|
|
//void calculateWH(String units, uint16_t &w, uint16_t &h) { |
|
|
|
|
|
// int x = 0; |
|
|
|
|
|
// int y = 0; |
|
|
|
|
|
// int16_t x1, y1; |
|
|
|
|
|
// uint16_t w1, h1; |
|
|
|
|
|
// |
|
|
|
|
|
// OLED.getTextBounds(units, x, y, &x1, &y1, &w1, &h1); |
|
|
|
|
|
// w = w1; |
|
|
|
|
|
// h = h1; |
|
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SetActualStatus(Status newStatus) { |
|
|
|
|
|
if (actualStatus != newStatus) { |
|
|
|
|
|
actualStatus = newStatus; |
|
|
|
|
|
Display.setRefreshScreen(); |
|
|
|
|
|
} |
|
|
|
|
|
} |