![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
bio robot
Dependencies: MPU6050-DMP QEI_hw mbed-rpc mbed
Fork of MPU6050_Example by
Comm/json.h
- Committer:
- amandaghassaei
- Date:
- 2015-12-03
- Revision:
- 2:17b18ea93551
File content as of revision 2:17b18ea93551:
#ifndef JSON_h #define JSON_h #include "mbed.h" class JSON { public: JSON(Serial* pc){ _pc = pc; } void open(){ _pc->printf("{"); } void close(){ _pc->printf("}\n"); } void sepItem(){ _pc->printf(","); } void print(char *key, float value){ _pc->printf("\""); _pc->printf(key); _pc->printf("\": \""); _pc->printf("%f", value); _pc->printf("\""); } void print(char *key, int value){ _pc->printf("\""); _pc->printf(key); _pc->printf("\": \""); _pc->printf("%i", value); _pc->printf("\""); } void print(char *key, char *value){ _pc->printf("\""); _pc->printf(key); _pc->printf("\": \""); _pc->printf(value); _pc->printf("\""); } private: Serial *_pc; }; #endif