Skip to content

Commit a26af52

Browse files
committed
Added versioning info to serial output (for production verification)
1 parent 5e5f979 commit a26af52

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

libraries/MySensors/examples/MysensorMicro/MysensorMicro.ino

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
// Define a static node address, remove if you want auto address assignment
1919
//#define NODE_ADDRESS 3
2020

21+
#define RELEASE "1.1"
22+
2123
// Child sensor ID's
2224
#define CHILD_ID_TEMP 1
2325
#define CHILD_ID_HUM 2
@@ -66,6 +68,10 @@ void setup() {
6668
digitalWrite(LED_PIN, LOW);
6769

6870
Serial.begin(115200);
71+
Serial.print(F("Sensebender Micro FW "));
72+
Serial.print(RELEASE);
73+
Serial.flush();
74+
6975
// First check if we should boot into test mode
7076

7177
pinMode(TEST_PIN,INPUT);
@@ -74,7 +80,7 @@ void setup() {
7480

7581
digitalWrite(TEST_PIN,LOW);
7682
digitalWrite(LED_PIN, HIGH);
77-
83+
7884
#ifdef NODE_ADDRESS
7985
gw.begin(NULL, NODE_ADDRESS, false);
8086
#else
@@ -84,8 +90,9 @@ void setup() {
8490
digitalWrite(LED_PIN, LOW);
8591

8692
humiditySensor.begin();
87-
88-
gw.sendSketchInfo("Sensebender Micro", "1.0");
93+
Serial.flush();
94+
Serial.println(F(" - Online!"));
95+
gw.sendSketchInfo("Sensebender Micro", RELEASE);
8996

9097
gw.present(CHILD_ID_TEMP,S_TEMP);
9198
gw.present(CHILD_ID_HUM,S_HUM);
@@ -105,8 +112,7 @@ void loop() {
105112
// This allows us to print debug messages on startup (as serial port is dependend on oscilator settings).
106113
if (measureCount == 5) switchClock(1<<CLKPS2); // Switch to 1Mhz for the reminder of the sketch, save power.
107114

108-
if (measureCount > FORCE_TRANSMIT_INTERVAL
109-
) { // force a transmission
115+
if (measureCount > FORCE_TRANSMIT_INTERVAL) { // force a transmission
110116
forceTransmit = true;
111117
measureCount = 0;
112118
}
@@ -213,7 +219,7 @@ void testMode()
213219
byte tests = 0;
214220

215221
digitalWrite(LED_PIN, HIGH); // Turn on LED.
216-
222+
Serial.println(F(" - TestMode"));
217223
Serial.println(F("Testing peripherals!"));
218224
Serial.flush();
219225
Serial.print(F("-> SI7021 : "));

0 commit comments

Comments
 (0)