Last active
December 17, 2015 12:09
-
-
Save don/5607769 to your computer and use it in GitHub Desktop.
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
var macAddress = "00:00:AA:BB:CC:DD"; | |
var connected = function() { | |
// connected, do something | |
}; | |
var disconnected = funtion(error) { | |
// disconnected | |
}; | |
bluetoothSerial.connect(macAddress, connected, disconnected); |
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
var onMessage = function(data) { | |
console.log(data); | |
}; | |
bluetoothSerial.subscribe("\n", onMessage, onFailure); |
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
bluetoothSerial.write("c255,0,0\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment