     }
     
     public static func setTargetTilt(grade: Double) -> CommandPacket {
-        let targetTilt = UInt16(grade * 100)
+        let targetTilt = UInt16(bitPattern: Int16(grade * 100))
         let data = [
             UInt8(targetTilt & 0xFF),
             UInt8(targetTilt >> 8 & 0xFF)

        
        public var currentTilt: Double? {
            if eventCode == .currentTiltChanged && bytes.count >= 2 {
                return Double(UInt16(bytes[1]) << 8 | UInt16(bytes[0])) / 100
            }
            return nil
        }
        
        public var minimumTilt: Double? {
            if [EventCode.tiltLimitsAvailable, .tiltLimitsChanged].contains(eventCode) && bytes.count >= 2 {
                return Double(UInt16(bytes[1]) << 8 | UInt16(bytes[0])) / 100
            }
            return nil
        }
        
        public var maximumTilt: Double? {
            if [EventCode.tiltLimitsAvailable, .tiltLimitsChanged].contains(eventCode) && bytes.count >= 4 {
                return Double(UInt16(bytes[3]) << 8 | UInt16(bytes[2])) / 100
            }
            return nil
        }

        
        public var targetTilt: Double? {
            if eventCode == .targetTiltChanged && bytes.count >= 2 {
                return decodeTilt(lsb: bytes[0], msb: bytes[1])
            }
            return nil
        }
