soooo close!
This commit is contained in:
parent
5e181324b5
commit
562ab4a6cd
24
B6-temp.md
24
B6-temp.md
|
@ -175,23 +175,21 @@ end
|
|||
|
||||
counter16 = 0
|
||||
function onMotor6(bus, id, dlc, data)
|
||||
engineTorque = getBitRange(data, 8, 8) * 0.39
|
||||
actualTorque = getBitRange(data, 16, 8) * 0.39
|
||||
feedbackGearbox = getBitRange(data, 40, 8) * 0.39
|
||||
|
||||
counter16 = (counter16 + 1) % 16
|
||||
|
||||
-- engineTorque = getBitRange(data, 8, 8) * 0.39
|
||||
-- actualTorque = getBitRange(data, 16, 8) * 0.39
|
||||
-- feedbackGearbox = getBitRange(data, 40, 8) * 0.39
|
||||
engineTorque = fakeTorque * 0.9
|
||||
actualTorque = fakeTorque
|
||||
feedbackGearbox = 255
|
||||
|
||||
-- engineTorque = fakeTorque * 0.9
|
||||
-- actualTorque = fakeTorque
|
||||
-- feedbackGearbox = 255
|
||||
motor6Data[2] = math.floor(engineTorque / 0.39)
|
||||
motor6Data[3] = math.floor(actualTorque / 0.39)
|
||||
motor6Data[6] = math.floor(feedbackGearbox / 0.39)
|
||||
setBitRange(motor6Data, 60, 4, counter16)
|
||||
|
||||
motor6Data[2] = math.floor(engineTorque / 0.39)
|
||||
motor6Data[3] = math.floor(actualTorque / 0.39)
|
||||
motor6Data[6] = math.floor(feedbackGearbox / 0.39)
|
||||
setBitRange(motor6Data, 60, 4, counter16)
|
||||
|
||||
xorChecksum(motor6Data, 1)
|
||||
xorChecksum(motor6Data, 1)
|
||||
txCan(TCU_BUS, id, 0, motor6Data)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue