Koduino
|
#include <OpenLog.h>
NOTE: the preferred way to talk to the OpenLog now is using the BulkSerial class. The "reading on a computer" example below is still pertinent and log files are back/forward compatible.
This is a library of high level functions for OpenLog v3 firmware attached on some serial port. A lot of the functions are from the read example from SparkFun. All the file ops are performed by OpenLog, and this library adds
__attribute__ ((packed))
.true
to start logging, false
to stop.In a MATLAB command window,
Thanks, Pranav Bhounsule, for help with this parsing script.
First, you need to have Python:
System
, and then click Advanced system settings
on the left.Environment variables
in the windows that opens.New...
in the top pane; enter KODUINO_DIR
for "variable name," and C:\Users\<username>\Documents\arduino-1.6.1\hardware\koduino\stm32
for "Variable value," where you replace <username
with your Windows username. Click OK
.PATH
, click Edit...
C:\Users\<username>\Anaconda2
, C:\Users\<username>\Anaconda2\Scripts
, C:\Users\<username>\Anaconda2\Library\bin
conda install numpy scipy matplotlib
python
in command prompt.Once you have Python, from a terminal,
To display more information about the command line options:
Public Member Functions | |
OpenLog (uint8_t rst, USARTClass &Ser, uint32_t baud) | |
Constructor to set up hardware connections to the OpenLog. More... | |
bool | init (const char *header, const char *fmt, uint32_t packetSize, bool check) |
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... | |
|
inline |
Constructor to set up hardware connections to the OpenLog.
rst | Reset pin |
Ser | Connected Serial port |
baud | Baud rate (must match setting in CONFIG.TXT on the SD card) |
void OpenLog::enable | ( | bool | flag | ) |
Start / stop logging data.
flag |
bool OpenLog::init | ( | const char * | header, |
const char * | fmt, | ||
uint32_t | packetSize, | ||
bool | check | ||
) |
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 OpenLog::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 |