This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let START_BYTE: UInt8 = 0x42 // or whatever | |
let ACTION_ON: UInt8 = 0x01 // or whatever | |
let ACTION_SLIDER: UInt8 = 0x02 // same here | |
var state = 0 | |
var code: UInt8 = 0 | |
var expected_count = 0 | |
var data = [UInt8]() | |
func serialDidReceiveBytes(bytes: [UInt8]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********** Here's the javascript version ************* | |
// /** | |
// * Set raw Rx values over MSP protocol. | |
// * | |
// * Channels is an array of 16-bit unsigned integer channel values to be sent. 8 channels is probably the maximum. | |
// **/ | |
// | |
//MSP.setRawRx = function(channels) { |