Skip to content

API Reference for the SFE_QUAD_Sensors__SD class

Methods to support writing/reading the sensors and menu configuration to/from storage using the standard Arduino SD library.

Methods

beginStorage()

This method: records the configuration file name; performs a SD.begin().

bool beginStorage(int csPin, const char *theFileName)
Parameter Type Description
csPin int The SPI Chip Select pin
theFilename const char * A pointer to the storage filename
return value bool true is successful, otherwise false

writeConfigurationToStorage()

This method writes the menu and sensor configuration from the configuration dynamic char array into the configuration file.

If append is false (default) the configuration file will be overwritten.

If append is true, the configuration is appended to the end of the file, preserving any existing configuration data. This can be useful if different sensors are connected for different logging runs. If a sensor configuration is included twice, both will be applied with the newest configuration superseding the older.

bool writeConfigurationToStorage(bool append)
Parameter Type Description
append bool If false (default) new data overwrites old. If true, new data is apended to old
return value bool true if the data is written successfully, otherwise false

readConfigurationFromStorage()

This method reads the menu and sensor configuration from storage, copying it into the configuration dynamic char array.

bool readConfigurationFromStorage(void)
Parameter Type Description
return value bool true if the data is read successfully, otherwise false

endStorage()

This method would be used to call the storage's end method - if it had one. For SD, it does nothing and simply returns true.

bool endStorage(void);
Parameter Type Description
return value bool Always true

Member Variables

Parameter Type Description
_theStorage File A File object, used to hold the sensor and menu configuration
_theStorageName char * A dynamic char array which holds the configuration file name