From 270144935a3759cfbb699a2027d9b8e19c7e0e59 Mon Sep 17 00:00:00 2001 From: jancoow Date: Wed, 22 Jun 2016 01:12:08 +0200 Subject: [PATCH] Fixed for controller case --- Controller/Controller.ino | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Controller/Controller.ino b/Controller/Controller.ino index 336c582..cde903e 100644 --- a/Controller/Controller.ino +++ b/Controller/Controller.ino @@ -196,6 +196,10 @@ void readMpu6050(struct MPU6050Data *mpu6050data){ mpu6050data->pitch = pitch*100; mpu6050data->roll = roll*100; mpu6050data->yaw = 0; + mpu6050data->ax = ax_scaled; + mpu6050data->ay = ay_scaled; + mpu6050data->az = az_scaled; + } void readJoystick(struct JoystickData *joystickdata){ @@ -296,6 +300,7 @@ void sendUdpMessage(struct JoystickData *joystick, struct MPU6050Data *mpu6050da sprintf(sendBuffer, "%06d|%06d|%01d|", joystick->x, joystick->y, joystick->button); sprintf(sendBuffer, "%s%06d|%06d|%06d|", sendBuffer, mpu6050data->yaw, mpu6050data->pitch, mpu6050data->roll); sprintf(sendBuffer, "%s%01d|%01d", sendBuffer, switchdata->backSwitch, switchdata->magnetSwitch); + sprintf(sendBuffer, "%s%06d|%06d|%06d", sendBuffer, mpu6050data->ax, mpu6050data->ay, mpu6050data->az); Serial.printf("%s", sendBuffer); Serial.println(); Udp.write(sendBuffer);