Skip to content

Commit 3c48d74

Browse files
committed
Modify updated mcp9808 interface
1 parent e20f7a4 commit 3c48d74

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/examples/sandbox/sandbox.ino

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void setup() {
228228
Log.infof("Starting sandbox / landing page procedure. Version = %s\r\n",
229229
SANDBOX_VERSION);
230230

231-
if (mcp9808.begin() == -1) {
231+
if (Mcp9808.begin() == -1) {
232232
Log.error("Could not initialize the temperature sensor");
233233
}
234234

@@ -255,6 +255,7 @@ void setup() {
255255
}
256256

257257
void loop() {
258+
258259
if (event_flags & NETWORK_CONN_FLAG) {
259260
switch (state) {
260261
case NOT_CONNECTED:
@@ -384,7 +385,7 @@ void loop() {
384385

385386
state = STREAMING_DATA;
386387

387-
Log.infof("Starting to stream data for %d seoncds\r\n",
388+
Log.infof("Starting to stream data for %d seconds\r\n",
388389
target_seconds);
389390
startStreamTimer();
390391
break;
@@ -419,12 +420,10 @@ void loop() {
419420
sprintf(transmit_buffer,
420421
"{\"type\": \"data\",\
421422
\"data\": { \
422-
\"Light\": %d, \
423423
\"Temperature\": %d \
424424
} \
425425
}",
426-
5,
427-
int(mcp9808.read_temp_c()));
426+
int(Mcp9808.readTempC()));
428427

429428
if (!MqttClient.publish(mqtt_pub_topic, transmit_buffer)) {
430429
Log.errorf("Could not publish message: %s\r\n",

0 commit comments

Comments
 (0)