SapFlow Probe
A low-cost HRM probe for measuring a tree's water consumption
sd_log.h File Reference
#include <SPI.h>
#include <SdFat.h>
#include <sdios.h>
#include "pinout.h"
#include "ftoa.h"

Functions

static ArduinoOutStream cout (Serial)
 Allows use of streams to print to Serial via cout. More...
 
String newfile (String fname, String suffix=".csv")
 Avoids file conflicts by renaming. More...
 
String int2str (int32_t x)
 Converts an integer to a string. More...
 

Variables

static SdFat sd
 File system object.
 

Function Documentation

◆ cout()

static ArduinoOutStream cout ( Serial  )
static

Allows use of streams to print to Serial via cout.

Returns
an ArduinoOutStream. Please don't use the return value.

Referenced by baseline(), delta(), and measure().

◆ int2str()

String int2str ( int32_t  x)

Converts an integer to a string.

Parameters
xThe integer
Returns
a string containing a text representation of x

Referenced by delta(), and measure().

◆ newfile()

String newfile ( String  fname,
String  suffix = ".csv" 
)

Avoids file conflicts by renaming.

Checks if the filename exists. If so, appends an integer. For example, if "test.csv" and "test(01).csv" are present in the file system and you call String x = newfile("test"); x will contain the string "test(02).csv"

Parameters
fnameThe desired file name (without the extension)
suffixThe file extension
Returns
the new filename it came up with.

References sd.