-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update Examples #115
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
@@ -90,7 +87,6 @@ void loop() | |
static unsigned eventCounter = 0; | ||
if (++eventCounter > 25) | ||
{ | ||
txRxPinsSerial.println("Demo cycle complete. Program stopped. Press RESET to restart."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
@@ -206,7 +196,6 @@ void loop() | |
{ | ||
JAddNumberToObject(body, "temp", temperature); | ||
JAddNumberToObject(body, "voltage", voltage); | ||
JAddNumberToObject(body, "count", eventCounter); | ||
} | ||
notecard.sendRequest(req); | ||
} | ||
|
There was a problem hiding this comment.
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.