Skip to content

Commit 9f8fd06

Browse files
authored
Ray memory (#84)
* remove note-c before re-add * Squashed 'src/note-c/' content from commit 4487b27 git-subtree-dir: src/note-c git-subtree-split: 4487b2723f2bb4f72ebe83bab76fafc2f6e63546 * feat: v1.3.14
1 parent 054a72f commit 9f8fd06

File tree

17 files changed

+401
-125
lines changed

17 files changed

+401
-125
lines changed

examples/Example0_LibrarylessCommunication/Example0_LibrarylessCommunication.ino

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
// would use Serial2.
1515
//
1616
// Note that both of these definitions are optional; just prefix either line with // to remove it.
17-
// Remove serialNotecard if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
17+
// Remove txRxPinsSerial if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
1818

1919
#if defined(ARDUINO_ARCH_AVR) && not defined(HAVE_HWSERIAL1)
20-
#define serialNotecard Serial
20+
#define txRxPinsSerial Serial
2121
#elif defined(ARDUINO_ARCH_STM32) && not defined(HAVE_HWSERIAL1)
22-
#define serialNotecard Serial
22+
#define txRxPinsSerial Serial
2323
#else
24-
#define serialNotecard Serial1
24+
#define txRxPinsSerial Serial1
2525
#endif
2626

2727
#ifdef ARDUINO_NRF52840_FEATHER
@@ -44,21 +44,21 @@ void setup()
4444
// Initialize the serial port being used by the Notecard, and send a newline to clear out any data
4545
// that the Arduino software may have pending so that we always start sending commands "cleanly".
4646
// We use the speed of 9600 because the Notecard's RX/TX pins are always configured for that speed.
47-
serialNotecard.begin(9600);
48-
serialNotecard.println("\n");
47+
txRxPinsSerial.begin(9600);
48+
txRxPinsSerial.println("\n");
4949

5050
// This command (required) causes the data to be delivered to the Project on notehub.io that has claimed
5151
// this Product ID. (see above)
52-
serialNotecard.println("{\"req\":\"service.set\",\"product\":\"" myProductID "\"}");
52+
txRxPinsSerial.println("{\"req\":\"service.set\",\"product\":\"" myProductID "\"}");
5353

5454
// This command determines how often the Notecard connects to the service. If "continuous" the Notecard
5555
// immediately establishes a session with the service at notehub.io, and keeps it active continuously.
5656
// Because of the power requirements of a continuous connection, a battery powered device would instead
5757
// only sample its sensors occasionally, and would only upload to the service on a periodic basis.
5858
#if myLiveDemo
59-
serialNotecard.println("{\"req\":\"service.set\",\"mode\":\"continuous\"}");
59+
txRxPinsSerial.println("{\"req\":\"service.set\",\"mode\":\"continuous\"}");
6060
#else
61-
serialNotecard.println("{\"req\":\"service.set\",\"mode\":\"periodic\",\"outbound\":60}");
61+
txRxPinsSerial.println("{\"req\":\"service.set\",\"mode\":\"periodic\",\"outbound\":60}");
6262
#endif
6363

6464
}
@@ -97,7 +97,7 @@ void loop()
9797
(int)temperature, abs(((int)(temperature*100.0)%100)),
9898
(int)voltage, (int)(voltage*100.0)%100,
9999
eventCounter);
100-
serialNotecard.println(message);
100+
txRxPinsSerial.println(message);
101101

102102
// Delay between simulated measurements
103103
#if myLiveDemo

examples/Example1_NotecardBasics/Example1_NotecardBasics.ino

+9-9
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
// can use any available port.
3131
//
3232
// Note that both of these definitions are optional; just prefix either line with // to remove it.
33-
// Remove serialNotecard if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
34-
// Remove serialDebug if you don't want the Notecard library to output debug information
33+
// Remove txRxPinsSerial if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
34+
// Remove usbSerial if you don't want the Notecard library to output debug information
3535

36-
//#define serialNotecard Serial1
37-
#define serialDebugOut Serial
36+
//#define txRxPinsSerial Serial1
37+
#define usbSerial Serial
3838

3939
// This is the unique Product Identifier for your device. This Product ID tells the Notecard what
4040
// type of device has embedded the Notecard, and by extension which vendor or customer is in charge
@@ -57,15 +57,15 @@ void setup()
5757
// Note that the initial 2.5s delay is required by some Arduino cards before debug
5858
// UART output can be successfully displayed in the Arduino IDE, including the
5959
// Adafruit Feather nRF52840 Express.
60-
#ifdef serialDebugOut
60+
#ifdef usbSerial
6161
delay(2500);
62-
serialDebugOut.begin(115200);
63-
notecard.setDebugOutputStream(serialDebugOut);
62+
usbSerial.begin(115200);
63+
notecard.setDebugOutputStream(usbSerial);
6464
#endif
6565

6666
// Initialize the physical I/O channel to the Notecard
67-
#ifdef serialNotecard
68-
notecard.begin(serialNotecard, 9600);
67+
#ifdef txRxPinsSerial
68+
notecard.begin(txRxPinsSerial, 9600);
6969
#else
7070
Wire.begin();
7171

examples/Example2_PeriodicCommunications/Example2_PeriodicCommunications.ino

+9-9
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
#include <Wire.h>
5151

5252
// Note that both of these definitions are optional; just prefix either line with // to remove it.
53-
// Remove serialNotecard if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
54-
// Remove serialDebug if you don't want the Notecard library to output debug information
55-
// #define serialNotecard Serial1
56-
#define serialDebugOut Serial
53+
// Remove txRxPinsSerial if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
54+
// Remove usbSerial if you don't want the Notecard library to output debug information
55+
// #define txRxPinsSerial Serial1
56+
#define usbSerial Serial
5757

5858
// This is the unique Product Identifier for your device.
5959
#define myProductID "com.your-company.your-name:your_project"
@@ -76,15 +76,15 @@ void setup()
7676
// During development, set up for debug output from the Notecard. Note that the initial delay is
7777
// required by some Arduino cards before debug UART output can be successfully displayed in the
7878
// Arduino IDE, including the Adafruit Feather nRF52840 Express.
79-
#ifdef serialDebugOut
79+
#ifdef usbSerial
8080
delay(2500);
81-
serialDebugOut.begin(115200);
82-
notecard.setDebugOutputStream(serialDebugOut);
81+
usbSerial.begin(115200);
82+
notecard.setDebugOutputStream(usbSerial);
8383
#endif
8484

8585
// Initialize the physical I/O channel to the Notecard
86-
#ifdef serialNotecard
87-
notecard.begin(serialNotecard, 9600);
86+
#ifdef txRxPinsSerial
87+
notecard.begin(txRxPinsSerial, 9600);
8888
#else
8989
Wire.begin();
9090

examples/Example3_InboundPolling/Example3_InboundPolling.ino

+9-9
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
#define INBOUND_QUEUE_COMMAND_FIELD "my-request-type"
2828

2929
// Note that both of these definitions are optional; just prefix either line with // to remove it.
30-
// Remove serialNotecard if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
31-
// Remove serialDebug if you don't want the Notecard library to output debug information
32-
// #define serialNotecard Serial1
33-
#define serialDebugOut Serial
30+
// Remove txRxPinsSerial if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
31+
// Remove usbSerial if you don't want the Notecard library to output debug information
32+
// #define txRxPinsSerial Serial1
33+
#define usbSerial Serial
3434

3535
// This is the unique Product Identifier for your device.
3636
#define myProductID "com.your-company.your-name:your_project"
@@ -42,15 +42,15 @@ void setup()
4242
{
4343

4444
// Set up for debug output.
45-
#ifdef serialDebugOut
45+
#ifdef usbSerial
4646
delay(2500);
47-
serialDebugOut.begin(115200);
48-
notecard.setDebugOutputStream(serialDebugOut);
47+
usbSerial.begin(115200);
48+
notecard.setDebugOutputStream(usbSerial);
4949
#endif
5050

5151
// Initialize the physical I/O channel to the Notecard
52-
#ifdef serialNotecard
53-
notecard.begin(serialNotecard, 9600);
52+
#ifdef txRxPinsSerial
53+
notecard.begin(txRxPinsSerial, 9600);
5454
#else
5555
Wire.begin();
5656

examples/Example4_InboundInterrupts/Example4_InboundInterrupts.ino

+9-9
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
#define INBOUND_QUEUE_COMMAND_FIELD "my-request-type"
3333

3434
// Note that both of these definitions are optional; just prefix either line with // to remove it.
35-
// Remove serialNotecard if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
36-
// Remove serialDebug if you don't want the Notecard library to output debug information
37-
// #define serialNotecard Serial1
38-
#define serialDebugOut Serial
35+
// Remove txRxPinsSerial if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
36+
// Remove usbSerial if you don't want the Notecard library to output debug information
37+
// #define txRxPinsSerial Serial1
38+
#define usbSerial Serial
3939

4040
// This is the unique Product Identifier for your device.
4141
#define myProductID "com.your-company.your-name:your_project"
@@ -54,15 +54,15 @@ void setup()
5454
{
5555

5656
// Set up for debug output.
57-
#ifdef serialDebugOut
57+
#ifdef usbSerial
5858
delay(2500);
59-
serialDebugOut.begin(115200);
60-
notecard.setDebugOutputStream(serialDebugOut);
59+
usbSerial.begin(115200);
60+
notecard.setDebugOutputStream(usbSerial);
6161
#endif
6262

6363
// Initialize the physical I/O channel to the Notecard
64-
#ifdef serialNotecard
65-
notecard.begin(serialNotecard, 9600);
64+
#ifdef txRxPinsSerial
65+
notecard.begin(txRxPinsSerial, 9600);
6666
#else
6767
Wire.begin();
6868
notecard.begin();

examples/Example5_UsingTemplates/Example5_UsingTemplates.ino

+9-9
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
#include <stdlib.h>
3232

3333
// Note that both of these definitions are optional; just prefix either line with // to remove it.
34-
// Remove serialNotecard if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
35-
// Remove serialDebug if you don't want the Notecard library to output debug information
36-
// #define serialNotecard Serial1
37-
#define serialDebugOut Serial
34+
// Remove txRxPinsSerial if you wired your Notecard using I2C SDA/SCL pins instead of serial RX/TX
35+
// Remove usbSerial if you don't want the Notecard library to output debug information
36+
// #define txRxPinsSerial Serial1
37+
#define usbSerial Serial
3838

3939
// This is the unique Product Identifier for your device. This Product ID tells the Notecard what
4040
// type of device has embedded the Notecard, and by extension which vendor or customer is in charge
@@ -55,15 +55,15 @@ void setup()
5555
{
5656

5757
// Set up for debug output.
58-
#ifdef serialDebugOut
58+
#ifdef usbSerial
5959
delay(2500);
60-
serialDebugOut.begin(115200);
61-
notecard.setDebugOutputStream(serialDebugOut);
60+
usbSerial.begin(115200);
61+
notecard.setDebugOutputStream(usbSerial);
6262
#endif
6363

6464
// Initialize the physical I/O channel to the Notecard
65-
#ifdef serialNotecard
66-
notecard.begin(serialNotecard, 9600);
65+
#ifdef txRxPinsSerial
66+
notecard.begin(txRxPinsSerial, 9600);
6767
#else
6868
Wire.begin();
6969

examples/Example6_SensorTutorial/Example6_SensorTutorial.ino

+16-16
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@
1717

1818
Adafruit_BME680 bmeSensor;
1919

20-
//#define serialNotecard Serial1
21-
#define serialDebug Serial
20+
//#define txRxPinsSerial Serial1
21+
#define usbSerial Serial
2222

2323
#define productUID "com.your-company.your-name:your_project"
2424
Notecard notecard;
2525

2626
// One-time Arduino initialization
2727
void setup()
2828
{
29-
#ifdef serialDebug
29+
#ifdef usbSerial
3030
delay(2500);
31-
serialDebug.begin(115200);
32-
notecard.setDebugOutputStream(serialDebug);
31+
usbSerial.begin(115200);
32+
notecard.setDebugOutputStream(usbSerial);
3333
#endif
3434

3535
// Initialize the physical I/O channel to the Notecard
36-
#ifdef serialNotecard
37-
notecard.begin(serialNotecard, 9600);
36+
#ifdef txRxPinsSerial
37+
notecard.begin(txRxPinsSerial, 9600);
3838
#else
3939
Wire.begin();
4040

@@ -47,9 +47,9 @@ void setup()
4747
notecard.sendRequest(req);
4848

4949
if (!bmeSensor.begin()) {
50-
serialDebug.println("Could not find a valid BME680 sensor...");
50+
usbSerial.println("Could not find a valid BME680 sensor...");
5151
} else {
52-
serialDebug.println("BME680 Connected...");
52+
usbSerial.println("BME680 Connected...");
5353
}
5454

5555
bmeSensor.setTemperatureOversampling(BME680_OS_8X);
@@ -59,18 +59,18 @@ void setup()
5959
void loop()
6060
{
6161
if (! bmeSensor.performReading()) {
62-
serialDebug.println("Failed to obtain a reading...");
62+
usbSerial.println("Failed to obtain a reading...");
6363
delay(15000);
6464
return;
6565
}
6666

67-
serialDebug.print("Temperature = ");
68-
serialDebug.print(bmeSensor.temperature);
69-
serialDebug.println(" *C");
67+
usbSerial.print("Temperature = ");
68+
usbSerial.print(bmeSensor.temperature);
69+
usbSerial.println(" *C");
7070

71-
serialDebug.print("Humidity = ");
72-
serialDebug.print(bmeSensor.humidity);
73-
serialDebug.println(" %");
71+
usbSerial.print("Humidity = ");
72+
usbSerial.print(bmeSensor.humidity);
73+
usbSerial.println(" %");
7474

7575
J *req = notecard.newRequest("note.add");
7676
if (req != NULL) {

examples/Example7_PowerControl/Example7_PowerControl.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define hostSleepSeconds 60
2020

2121
// Arduino serial debug monitor port definitions
22-
#define serialDebug Serial
22+
#define usbSerial Serial
2323

2424
// Notecard I2C port definitions
2525
Notecard notecard;
@@ -49,8 +49,8 @@ void setup()
4949
// Arduino IDE requires a delay to move the serial port over
5050
// from programming the MCU to the debug monitor.
5151
delay(2500);
52-
serialDebug.begin(115200);
53-
notecard.setDebugOutputStream(serialDebug);
52+
usbSerial.begin(115200);
53+
notecard.setDebugOutputStream(usbSerial);
5454

5555
// Initialize the physical I2C I/O channel to the Notecard
5656
Wire.begin();

keywords.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ FUNCTIONS
88
==================================
99
begin KEYWORD2
1010
setDebugOutputStream KEYWORD2
11-
newCommand KEYWORD2
11+
clearDebugOutputStream KEYWORD2
1212
newRequest KEYWORD2
13+
newCommand KEYWORD2
1314
sendRequest KEYWORD2
1415
requestAndResponse KEYWORD2
1516
deleteResponse KEYWORD2

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Blues Wireless Notecard
2-
version=1.3.13
2+
version=1.3.14
33
author=Blues Wireless
44
maintainer=Blues Wireless <[email protected]>
55
sentence=An easy to use Notecard Library for Arduino.

0 commit comments

Comments
 (0)