Skip to content

Commit 2776fb7

Browse files
author
Mario
committed
update README
1 parent e7571cd commit 2776fb7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ Serial.printf("TS: %d, T: %.2f, H: %.2f, %u\n",
108108
Or the last row:
109109

110110
```cpp
111+
const time_t now = time(nullptr);
111112
const size_t rowCount = logger.rowCount(now);
112113
logger.readRows(&data, now, rowCount - 1, 1);
113114
```
@@ -125,15 +126,16 @@ Retrieving data from the last 20 minutes:
125126

126127
```cpp
127128
SPIFFSLogData<EnvData> data[25];
128-
size_t count = logger.readRowsBetween(&data, // output
129+
size_t count = logger.readRowsBetween(
130+
&data, // output
129131
now - (60 * 20), // time start (inclusive)
130132
now, // time end (inclusive)
131133
0, // start index within results
132-
25 // max number of rows to fetch (size your output buffer accordingly!)
134+
25 // max number of rows to fetch
133135
);
134136

135137
for (int i=0; i<count; i++) {
136-
Serial.printf("TS: %d, T: %.2f, H: %.2f, %u\n",
138+
Serial.printf("TS: %d, T: %.2f, H: %.2f, %u\n",
137139
data[i].timestampUTC,
138140
data[i].data.temperature,
139141
data[i].data.humidity,

0 commit comments

Comments
 (0)