GY-63_MS5611/libraries/MTP40C/examples/MTP40C_selfCalibration/MTP40C_selfCalibration.ino

82 lines
1.7 KiB
Arduino
Raw Normal View History

2021-08-23 13:33:25 -04:00
//
// FILE: MTP40C_selfCalibration.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo of MTP40C library
// DATE: 2021-08-23
// URL: https://github.com/RobTillaart/MTP40C
//
// any board that support two or more hardware serial ports
// Serial and Serial1, e.g. for MEGA, LEONARDO, MICRO, ESP32,ESP8266
// Uno, Nano or Mini will fail to compile.
#include "MTP40C.h"
2021-09-02 01:40:38 -04:00
#include "SoftwareSerial.h"
2021-08-23 13:33:25 -04:00
2021-09-02 01:40:38 -04:00
SoftwareSerial sws(6, 7);
MTP40C mtp(&sws);
// MTP40C mtp(&Serial1);
2021-08-23 13:33:25 -04:00
uint32_t start;
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
2021-09-02 01:40:38 -04:00
Serial.print("MTP40_LIB_VERSION:\t");
Serial.println(MTP40_LIB_VERSION);
2021-08-23 13:33:25 -04:00
2021-09-02 01:40:38 -04:00
sws.begin(19200);
mtp.begin(MTP40_DEFAULT_ADDRESS);
2021-08-23 13:33:25 -04:00
Serial.print("STAT:\t");
Serial.println(mtp.getSelfCalibrationStatus());
2021-09-02 01:40:38 -04:00
delay(100);
2021-08-23 13:33:25 -04:00
Serial.print("OPEN:\t");
Serial.println(mtp.openSelfCalibration());
2021-09-02 01:40:38 -04:00
delay(100);
2021-08-23 13:33:25 -04:00
Serial.print("STAT:\t");
Serial.println(mtp.getSelfCalibrationStatus());
2021-09-02 01:40:38 -04:00
delay(100);
2021-08-23 13:33:25 -04:00
Serial.print("CLOSE:\t");
Serial.println(mtp.closeSelfCalibration());
2021-09-02 01:40:38 -04:00
delay(100);
2021-08-23 13:33:25 -04:00
Serial.print("STAT:\t");
Serial.println(mtp.getSelfCalibrationStatus());
2021-09-02 01:40:38 -04:00
delay(100);
2021-08-23 13:33:25 -04:00
Serial.print("OPEN:\t");
Serial.println(mtp.openSelfCalibration());
2021-09-02 01:40:38 -04:00
delay(100);
Serial.print("STAT:\t");
Serial.println(mtp.getSelfCalibrationStatus());
delay(100);
2021-08-23 13:33:25 -04:00
Serial.println();
Serial.print("GET_HRS:\t");
uint16_t hrs = mtp.getSelfCalibrationHours();
Serial.println(hrs);
2021-09-02 01:40:38 -04:00
delay(100);
2021-08-23 13:33:25 -04:00
if (hrs > 720) hrs = 23;
Serial.print("SET_HRS:\t");
Serial.println(mtp.setSelfCalibrationHours(hrs + 1));
2021-09-02 01:40:38 -04:00
delay(100);
2021-08-23 13:33:25 -04:00
Serial.print("GET_HRS:\t");
Serial.println(mtp.getSelfCalibrationHours());
2021-09-02 01:40:38 -04:00
delay(100);
2021-08-23 13:33:25 -04:00
Serial.println("\ndone...");
}
void loop()
{
}
// -- END OF FILE --
2021-12-22 05:36:50 -05:00