#include <stdio.h>
#include <string.h>
#include <stdint.h>
-#include <sys/types.h>
+#include <unistd.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <fcntl.h>
#include <aversive.h>
char buf[BUFSIZ];
int len;
- len =snprintf(buf, sizeof(buf), "%d %d %d\n",
+ len = snprintf(buf, sizeof(buf), "%d %d %d\n",
position_get_x_s16(&mainboard.pos),
position_get_y_s16(&mainboard.pos),
position_get_a_deg_s16(&mainboard.pos));
+ hostsim_lock();
write(fd, buf, len);
+ hostsim_unlock();
}
void robotsim_pwm(void *arg, int32_t val)