Koduino
|
Class for logging to an SD card using SDIO (Mainboard v2 only) More...
#include <FatLog.h>
Public Member Functions | |
FatLog () | |
Constructor to set up hardware connections to the OpenLog. | |
LoggerStatus | init (String header, String fmt, uint32_t packetSize) |
Reset OpenLog and start a new log. More... | |
void | enable (bool flag) |
Start / stop logging data. More... | |
void | write (const uint8_t *bytes) |
Write a data buffer of size packetSize specified during init() More... | |
void FatLog::enable | ( | bool | flag | ) |
Start / stop logging data.
flag |
LoggerStatus FatLog::init | ( | String | header, |
String | fmt, | ||
uint32_t | packetSize | ||
) |
Reset OpenLog and start a new log.
Waits till OpenLog is connected (timeout is 3 seconds). Note that this will fail if an SD card is not plugged into the socket.
header | ASCII string containing a comma-separated list of short data column names |
fmt | ASCII string containing a python struct format string corresponding to a data row |
packetSize | Size of the entire packet |
void FatLog::write | ( | const uint8_t * | bytes | ) |
Write a data buffer of size packetSize
specified during init()
Only writes the data if the Serial TX buffer is empty (i.e. if the previous write operation finished).
bytes | Pointer to data buffer |