I have replicated Codapop's code for the most part in my setup with the same results. In my setup I have a slide pot controlling the throttle, and the same value is also sent to the ROTATION_MESSAGE.
throttleValue = analogRead(throttlePin);
throttleValue = map(throttleValue, 0, 1023, 32767, 0);
mySimpit.send(THROTTLE_MESSAGE, (unsigned char*) &throttleValue, 2);
rotation.pitch = throttleValue;
rotation.yaw = throttleValue;
rotation.roll = throttleValue;
mySimpit.send(ROTATION_MESSAGE, rotation);
In KSP, when I move the slide pot the throttle works fine, but no movement on any of the rotational controls.
EDIT:
On looking through the code on bitbucket (finally), it looks like the below callback is handling the rotational control messages. There is a bitwise and operation being performed against newRotation.mask, but I can't see newRotation.mask actually getting set anywhere. IIRC (and my memory of C# is pretty rusty, so I could easily be wrong) structs are always pre-zeroed, and performing a bitwise & against 0 is always going to give you zero. If all of the above is correct, it would make sense that nothing you send in will do anything, because the code will always evaluate it to zero! Stibbons, please correct me if I'm wrong here!
public void vesselRotationCallback(byte ID, object Data)
{
newRotation = KerbalSimpitUtils.ByteArrayToStructure<RotationalStruct>((byte[])Data);
// Bit fields:
// pitch = 1
// roll = 2
// yaw = 4
if ((newRotation.mask & (byte)1) > 0)
{
myRotation.pitch = newRotation.pitch;
}
if ((newRotation.mask & (byte)2) > 0)
{
myRotation.roll = newRotation.roll;
}
if ((newRotation.mask & (byte)4) > 0)
{
myRotation.yaw = newRotation.yaw;
}
}
EDIT 2:
After further review, the fix was incredibly simple like @Codapop expected, and I was just over-complicating things. All I did was add
rotation.mask = (byte)7;
To the code above and the throttle works as expected. Set rotation.mask based on which of the 3 axis' are getting updated (see lines 59-66 here. Luckily, debugging this (admittedly self inflicted) issue finally got me to pull down the repos and set up my make environment. Hopefully I'll be able to find time to work on them a little bit and open some pull requests.