consolidate all repos to one for archive
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#include "serial.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <string.h>
|
||||
#include <chrono>
|
||||
|
||||
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
|
||||
};
|
||||
Reference in New Issue
Block a user