Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Examples #115

Merged
merged 3 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/note-arduino-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@ jobs:
- ./examples/Example8_BinarySendReceive/Example8_BinarySendReceive.ino
- ./examples/Example9_BinarySendReceiveChunked/Example9_BinarySendReceiveChunked.ino
fully-qualified-board-name:
- STMicroelectronics:stm32:BluesW:pnum=SWAN_R5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alphabetized the list; librarian style.

- esp32:esp32:featheresp32
- adafruit:nrf52:feather52840:softdevice=s140v6
- adafruit:samd:adafruit_feather_m4
- STMicroelectronics:stm32:GenF4:pnum=FEATHER_F405
# The binary examples don't fit in the Uno's flash.
# - arduino:avr:uno
# TODO: Fix this. May require upstream fix.
# - arduino:mbed_nano:nano33ble
- esp32:esp32:featheresp32
- rp2040:rp2040:rpipico
- SparkFun:apollo3:sfe_artemis_thing_plus
- STMicroelectronics:stm32:BluesW:pnum=SWAN_R5
- STMicroelectronics:stm32:GenF4:pnum=FEATHER_F405
- STMicroelectronics:stm32:Nucleo_32:pnum=NUCLEO_L432KC
- adafruit:nrf52:feather52840:softdevice=s140v6
- rp2040:rp2040:rpipico
# The binary examples don't fit in the Uno's flash.
# - arduino:avr:uno

steps:
- name: Checkout code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
// Core IoT Development Kit, you would connect the R2 pin to the Notecard's TX
// pin, and the M5Stack's T2 pin to the Notecard's RX pin, and then would
// use Serial2.
//
// Note that both of these definitions are optional; just prefix either line
// with `//` to remove it.
// - Remove txRxPinsSerial if you wired your Notecard using I2C SDA/SCL pins
// instead of serial RX/TX
Copy link
Contributor Author

@zfields zfields Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed comment, because it is not possible to easily use I2C without the library.


#include "Arduino.h"

#if defined(ARDUINO_ARCH_AVR) && not defined(HAVE_HWSERIAL1)
#define txRxPinsSerial Serial
Expand Down Expand Up @@ -90,7 +87,6 @@ void loop()
static unsigned eventCounter = 0;
if (++eventCounter > 25)
{
txRxPinsSerial.println("Demo cycle complete. Program stopped. Press RESET to restart.");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Serial channel is used to communicate with the Notecard, not to log.

delay(10000); // 10 seconds
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void loop()
static unsigned eventCounter = 0;
if (++eventCounter > 25)
{
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.");
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.\n");
delay(10000); // 10 seconds
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,6 @@ void loop()
notecard.logDebug("performing sensor measurement\n");
lastStatusMs = millis();

// Count the simulated measurements that we send to the cloud, and stop the
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason to count and stop, because this demo is based on button presses.

// demo before long.
static unsigned eventCounter = 0;
if (++eventCounter > 25)
{
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.");
delay(10000); // 10 seconds
return;
}

// Read the notecard's current temperature and voltage, as simulated sensor
// measurements
double temperature = 0;
Expand Down Expand Up @@ -206,7 +196,6 @@ void loop()
{
JAddNumberToObject(body, "temp", temperature);
JAddNumberToObject(body, "voltage", voltage);
JAddNumberToObject(body, "count", eventCounter);
}
notecard.sendRequest(req);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void loop()
static unsigned eventCounter = 0;
if (++eventCounter > 25)
{
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.");
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.\n");
delay(10000); // 10 seconds
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void loop()
static unsigned eventCounter = 0;
if (++eventCounter > 25)
{
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.");
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.\n");
delay(10000); // 10 seconds
return;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/Example7_PowerControl/Example7_PowerControl.ino
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void loop()
// Bump the number of cycles
if (++globalState.cycles > 25)
{
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.");
notecard.logDebug("Demo cycle complete. Program stopped. Press RESET to restart.\n");
delay(10000); // 10 seconds
return;
}
Expand Down
Loading