LE YOU / func

Dependents:   mas

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Config.cpp Source File

Config.cpp

00001 #include "Config.h"
00002 
00003 Config::Config(char *filename)
00004 {
00005     FILE *fp = fopen(filename, "r+");
00006     if(!fp)
00007     {
00008         raise_error(ERROR_CONFIG);
00009     }
00010     strcpy(this->__filename, filename);
00011     fclose(fp);
00012 }
00013 
00014 void Config::write()
00015 {
00016     FILE *fp = fopen(this->__filename, "w+");
00017     if(!fp)
00018     {
00019         raise_error(ERROR_CONFIG);
00020     }
00021     fprintf(fp, "%d %d %d\n%d %d %d\n%d %d %d", this->__acc_offset[0], __acc_offset[1], __acc_offset[2], this->__gyo_offset[0], this->__gyo_offset[1], this->__gyo_offset[2], this->__mag_offset[0], this->__mag_offset[1], this->__mag_offset[2]);
00022     fclose(fp);
00023 }