14
14
// would use Serial2.
15
15
//
16
16
// 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
18
18
19
19
#if defined(ARDUINO_ARCH_AVR) && not defined(HAVE_HWSERIAL1)
20
- #define serialNotecard Serial
20
+ #define txRxPinsSerial Serial
21
21
#elif defined(ARDUINO_ARCH_STM32) && not defined(HAVE_HWSERIAL1)
22
- #define serialNotecard Serial
22
+ #define txRxPinsSerial Serial
23
23
#else
24
- #define serialNotecard Serial1
24
+ #define txRxPinsSerial Serial1
25
25
#endif
26
26
27
27
#ifdef ARDUINO_NRF52840_FEATHER
@@ -44,21 +44,21 @@ void setup()
44
44
// Initialize the serial port being used by the Notecard, and send a newline to clear out any data
45
45
// that the Arduino software may have pending so that we always start sending commands "cleanly".
46
46
// 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 " );
49
49
50
50
// This command (required) causes the data to be delivered to the Project on notehub.io that has claimed
51
51
// this Product ID. (see above)
52
- serialNotecard .println (" {\" req\" :\" service.set\" ,\" product\" :\" " myProductID " \" }" );
52
+ txRxPinsSerial .println (" {\" req\" :\" service.set\" ,\" product\" :\" " myProductID " \" }" );
53
53
54
54
// This command determines how often the Notecard connects to the service. If "continuous" the Notecard
55
55
// immediately establishes a session with the service at notehub.io, and keeps it active continuously.
56
56
// Because of the power requirements of a continuous connection, a battery powered device would instead
57
57
// only sample its sensors occasionally, and would only upload to the service on a periodic basis.
58
58
#if myLiveDemo
59
- serialNotecard .println (" {\" req\" :\" service.set\" ,\" mode\" :\" continuous\" }" );
59
+ txRxPinsSerial .println (" {\" req\" :\" service.set\" ,\" mode\" :\" continuous\" }" );
60
60
#else
61
- serialNotecard .println (" {\" req\" :\" service.set\" ,\" mode\" :\" periodic\" ,\" outbound\" :60}" );
61
+ txRxPinsSerial .println (" {\" req\" :\" service.set\" ,\" mode\" :\" periodic\" ,\" outbound\" :60}" );
62
62
#endif
63
63
64
64
}
@@ -97,7 +97,7 @@ void loop()
97
97
(int )temperature, abs (((int )(temperature*100.0 )%100 )),
98
98
(int )voltage, (int )(voltage*100.0 )%100 ,
99
99
eventCounter);
100
- serialNotecard .println (message);
100
+ txRxPinsSerial .println (message);
101
101
102
102
// Delay between simulated measurements
103
103
#if myLiveDemo
0 commit comments