C++ file for display control

Dependencies:   4DGL mbed ConfigFile

Fork of 4DGLtest by Stephane ROCHON

configread.cpp

Committer:
WillemBraat
Date:
2014-07-16
Revision:
11:a5b0d98794c0
Parent:
6:904d00252480

File content as of revision 11:a5b0d98794c0:

#include "mbed.h"
#include "ConfigFile.h"
 

 
void ConfigRead(void) {
    LocalFileSystem local("cdu");
    ConfigFile cfg;
    char *key = "MyKey";
    char value[BUFSIZ];
    /*
     * Read a configuration file from a mbed.
     */
    if (!cfg.read("/cdu/input.cfg")) {
        error("Failure to read a configuration file.\n");
    }
 
    /*
     * Get a configuration value.
     */
    if (cfg.getValue(key, &value[0], sizeof(value))) {
        printf("'%s'='%s'\n", key, value);
    }
}