JorgeVelez / as3-arduino-connector

Automatically exported from code.google.com/p/as3-arduino-connector
0 stars 1 forks source link

send as hax #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
if i want send a string"CC DD A0 00 00 00 0D AD 5A" from com port as hax. how 
to do?(Apologize for my Chinglish)

Original issue reported on code.google.com by feipinxi...@gmail.com on 20 Nov 2012 at 2:03

GoogleCodeExporter commented 8 years ago
I solved this problem.
function sendCom(str:String):void {
    var arr:Array = str.split(" ");
    for (var i:int = 0,len:int=arr.length; i < len; i++) {
        arduino.writeByte(parseInt(arr[i],16));
    }
}
sendCom("CC DD A0 00 00 00 0D AD 5A");

Original comment by feipinxi...@gmail.com on 21 Nov 2012 at 7:41

GoogleCodeExporter commented 8 years ago

Original comment by Nicholas...@gmail.com on 23 Apr 2013 at 3:27