Skip to content

Commit 404630f

Browse files
authored
Update Examples (#115)
1 parent 18b485a commit 404630f

File tree

7 files changed

+13
-28
lines changed

7 files changed

+13
-28
lines changed

.github/workflows/note-arduino-ci.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,18 @@ jobs:
109109
- ./examples/Example8_BinarySendReceive/Example8_BinarySendReceive.ino
110110
- ./examples/Example9_BinarySendReceiveChunked/Example9_BinarySendReceiveChunked.ino
111111
fully-qualified-board-name:
112-
- STMicroelectronics:stm32:BluesW:pnum=SWAN_R5
113-
- esp32:esp32:featheresp32
112+
- adafruit:nrf52:feather52840:softdevice=s140v6
114113
- adafruit:samd:adafruit_feather_m4
115-
- STMicroelectronics:stm32:GenF4:pnum=FEATHER_F405
114+
# The binary examples don't fit in the Uno's flash.
115+
# - arduino:avr:uno
116116
# TODO: Fix this. May require upstream fix.
117117
# - arduino:mbed_nano:nano33ble
118+
- esp32:esp32:featheresp32
119+
- rp2040:rp2040:rpipico
118120
- SparkFun:apollo3:sfe_artemis_thing_plus
121+
- STMicroelectronics:stm32:BluesW:pnum=SWAN_R5
122+
- STMicroelectronics:stm32:GenF4:pnum=FEATHER_F405
119123
- STMicroelectronics:stm32:Nucleo_32:pnum=NUCLEO_L432KC
120-
- adafruit:nrf52:feather52840:softdevice=s140v6
121-
- rp2040:rp2040:rpipico
122-
# The binary examples don't fit in the Uno's flash.
123-
# - arduino:avr:uno
124124

125125
steps:
126126
- name: Checkout code

examples/Example0_LibrarylessCommunication/Example0_LibrarylessCommunication.ino

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
// Core IoT Development Kit, you would connect the R2 pin to the Notecard's TX
1414
// pin, and the M5Stack's T2 pin to the Notecard's RX pin, and then would
1515
// use Serial2.
16-
//
17-
// Note that both of these definitions are optional; just prefix either line
18-
// with `//` to remove it.
19-
// - Remove txRxPinsSerial if you wired your Notecard using I2C SDA/SCL pins
20-
// instead of serial RX/TX
16+
17+
#include "Arduino.h"
2118

2219
#if defined(ARDUINO_ARCH_AVR) && not defined(HAVE_HWSERIAL1)
2320
#define txRxPinsSerial Serial
@@ -90,7 +87,6 @@ void loop()
9087
static unsigned eventCounter = 0;
9188
if (++eventCounter > 25)
9289
{
93-
txRxPinsSerial.println("Demo cycle complete. Program stopped. Press RESET to restart.");
9490
delay(10000); // 10 seconds
9591
return;
9692
}

examples/Example1_NotecardBasics/Example1_NotecardBasics.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void loop()
127127
static unsigned eventCounter = 0;
128128
if (++eventCounter > 25)
129129
{
130-
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.");
130+
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.\n");
131131
delay(10000); // 10 seconds
132132
return;
133133
}

examples/Example2_PeriodicCommunications/Example2_PeriodicCommunications.ino

-11
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,6 @@ void loop()
168168
notecard.logDebug("performing sensor measurement\n");
169169
lastStatusMs = millis();
170170

171-
// Count the simulated measurements that we send to the cloud, and stop the
172-
// demo before long.
173-
static unsigned eventCounter = 0;
174-
if (++eventCounter > 25)
175-
{
176-
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.");
177-
delay(10000); // 10 seconds
178-
return;
179-
}
180-
181171
// Read the notecard's current temperature and voltage, as simulated sensor
182172
// measurements
183173
double temperature = 0;
@@ -206,7 +196,6 @@ void loop()
206196
{
207197
JAddNumberToObject(body, "temp", temperature);
208198
JAddNumberToObject(body, "voltage", voltage);
209-
JAddNumberToObject(body, "count", eventCounter);
210199
}
211200
notecard.sendRequest(req);
212201
}

examples/Example5_UsingTemplates/Example5_UsingTemplates.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void loop()
155155
static unsigned eventCounter = 0;
156156
if (++eventCounter > 25)
157157
{
158-
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.");
158+
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.\n");
159159
delay(10000); // 10 seconds
160160
return;
161161
}

examples/Example6_SensorTutorial/Example6_SensorTutorial.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void loop()
6666
static unsigned eventCounter = 0;
6767
if (++eventCounter > 25)
6868
{
69-
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.");
69+
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.\n");
7070
delay(10000); // 10 seconds
7171
return;
7272
}

examples/Example7_PowerControl/Example7_PowerControl.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void loop()
134134
// Bump the number of cycles
135135
if (++globalState.cycles > 25)
136136
{
137-
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.");
137+
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.\n");
138138
delay(10000); // 10 seconds
139139
return;
140140
}

0 commit comments

Comments
 (0)