This object is provided under license. By downloading this object, you are agreeing to the terms of the MIT License.
|
|
StefanL39 commented:
I gave this object a fivestar-rating because it adds the following methods
PUB rxDec : Value | place, ptr, x
{{
Accepts and returns serial decimal values, such as "1234" as a number.
String must end in a carriage return (ASCII 13)
x:= Serial.rxDec ' accept string of digits for value
}}
PUB rxDecTime(ms) :Value | place, ptr, x, temp
{{
Accepts and returns serial decimal values, such as "1234" as a number
with a timeout value. No data returns -1
String must end in a carriage return (ASCII 13)
x := Serial.rxDecTime(100) ' accept data with timeout of 100mS
}}
PUB rxHex ------------ PUB rxHexTime(ms)--------------
PUB RxStr (stringptr) : Value | ptr
{{
Accepts a string of characters - up to 15 - to be passed by reference
String acceptance terminates with a carriage return or the defined delimiter character.
Will accept up to 15 characters before passing back.
Serial.Rxstr(@MyStr) ' accept
serial.str(@MyStr) ' transmit
}}
PUB IntOfString (stringptr): Value | negFlag
{{ Returns the integer or whole portion of a string with a decimal point.
serial.RxString(@myStr))
x := serial.IntOfString(@myStr)
"-123.456" will return -123
}}
PUB FracOfString (stringptr): Value | decFlag
{{ Returns the fractional or decimal portion of a string with a decimal point.
serial.RxString(@myStr))
x := serial.FracOfString(@myStr)
"-123.456" will return 456
}}
May 30, 2008 6:44 p.m.
|
|