C++ file for display control

Dependencies:   4DGL mbed ConfigFile

Fork of 4DGLtest by Stephane ROCHON

configread.cpp

Committer:
WillemBraat
Date:
2014-07-01
Revision:
6:904d00252480
Parent:
4:302c2ac97db9

File content as of revision 6:904d00252480:

#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);
    }
}