Koduino
Public Member Functions | List of all members
FatLog Class Reference

Class for logging to an SD card using SDIO (Mainboard v2 only) More...

#include <FatLog.h>

Detailed Description

Class for logging to an SD card using SDIO (Mainboard v2 only)

See also
OpenLog

Usage

Example

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...
 

Member Function Documentation

void FatLog::enable ( bool  flag)

Start / stop logging data.

Parameters
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.

Parameters
headerASCII string containing a comma-separated list of short data column names
fmtASCII string containing a python struct format string corresponding to a data row
packetSizeSize of the entire packet
Returns
true if connected, false if failed
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).

Parameters
bytesPointer to data buffer

The documentation for this class was generated from the following files: