So, in my previous blog post I mentioned a friend was looking at reading some data over the serial port from a set of scales. He did however come up against a small problem, the scales needed to be set a command code before they would output the weight.
So a pure send -> receive relationship.
Of-course the next stumbling block is that they want a byte code of 5 to be sent to initiate the conversation, not so easy now 😦
Thankfully Jscript has a pretty easy way to deal with this situation, the String object has a method called fromCharCode() which will take a decimal value and spit out the character code.
An example here is outputting the character code 48 (which is the number 0) would look something like this:
var strCode2 : String = String.fromCharCode(48);
Happy coding! 🙂