-
Notifications
You must be signed in to change notification settings - Fork 0
Version info
Tiogaplanet edited this page Oct 9, 2018
·
2 revisions
These functions report MiP's version numbers for hardware and software.
void readSoftwareVersion(MiPSoftwareVersion& software)
Get the version information for MiP's software.
- software is a MiPSoftwareVersion object to be filled in with MiP's software version information.
class MiPSoftwareVersion
{
public:
// ...
uint16_t year;
uint8_t month;
uint8_t day;
uint8_t uniqueVersion;
};
Nothing
#include <mip_esp8266.h>
MiP mip;
void setup() {
bool connectResult = mip.begin();
if (!connectResult) {
Serial.println(F("Failed connecting to MiP!"));
return;
}
Serial.println(F("SoftwareHardwareVersion.ino - Use readSoftwareVersion() & readHardwareInfo() functions."));
MiPSoftwareVersion softwareVersion;
mip.readSoftwareVersion(softwareVersion);
Serial.print(F("software version: "));
Serial.print(softwareVersion.year);
Serial.print('-');
Serial.print(softwareVersion.month);
Serial.print('-');
Serial.print(softwareVersion.day);
Serial.print('.');
Serial.println(softwareVersion.uniqueVersion);
MiPHardwareInfo hardwareInfo;
mip.readHardwareInfo(hardwareInfo);
Serial.println(F("hardware info"));
Serial.print(F(" voice chip version: "));
Serial.println(hardwareInfo.voiceChip);
Serial.print(F(" hardware version: "));
Serial.println(hardwareInfo.hardware);
Serial.println();
Serial.println(F("Sample done."));
}
void loop() {
}
void readHardwareInfo(MiPHardwareInfo& hardware)
Get the version information for MiP's hardware.
- hardware is a MiPHardwareInfo object to be filled in with MiP's hardware version information.
class MiPHardwareInfo
{
public:
// ...
uint8_t voiceChip;
uint8_t hardware;
};
Nothing
#include <mip_esp8266.h>
MiP mip;
void setup() {
bool connectResult = mip.begin();
if (!connectResult) {
Serial.println(F("Failed connecting to MiP!"));
return;
}
Serial.println(F("SoftwareHardwareVersion.ino - Use readSoftwareVersion() & readHardwareInfo() functions."));
MiPSoftwareVersion softwareVersion;
mip.readSoftwareVersion(softwareVersion);
Serial.print(F("software version: "));
Serial.print(softwareVersion.year);
Serial.print('-');
Serial.print(softwareVersion.month);
Serial.print('-');
Serial.print(softwareVersion.day);
Serial.print('.');
Serial.println(softwareVersion.uniqueVersion);
MiPHardwareInfo hardwareInfo;
mip.readHardwareInfo(hardwareInfo);
Serial.println(F("hardware info"));
Serial.print(F(" voice chip version: "));
Serial.println(hardwareInfo.voiceChip);
Serial.print(F(" hardware version: "));
Serial.println(hardwareInfo.hardware);
Serial.println();
Serial.println(F("Sample done."));
}
void loop() {
}