#include "serial.h" #include #include #include #include int main() { serial s; if (!s.init("/dev/ttyACM0")) { return 1; } int16_t buf[50]; s.sread((uint8_t *)buf, sizeof(buf)); while (true) { s.sread((uint8_t *)buf, sizeof(buf)); if ('{' == *(char *)&buf[0]) printf("%s\n", (char *)&buf[0]); else printf("%x %6d %6d %6d %6d %6d\n", (uint16_t)buf[0], (uint16_t)buf[1], buf[2], buf[3], buf[4], buf[5]); } return 0; // success };