Data Storage Tool Display Human Input Protocol Math Motor Control Sensor Signal Generation & Processing Speech & Sound Fun View all Objects


Quick Links
Contact Us
Forums
Support

Register
Login

This object is provided under license. By downloading this object, you are agreeing to the terms of the MIT License.

Extended Full Duplex Serial

Extends out FullDuplexSerial to allow reception of character strings that end in a carriage return for decimal, hexadecimal and alpha-numeric uses. Allows use of timeout values. This version also allows use of defined delimiter characters, and returning whole and fractional portions of a numeric string. Fully documented with examples.

Version:
  1.1

Attributes:


Author:
  Martin Hebel

Categories:
  Protocol

Downloads:
  3,204

Last Updated:
  2008-03-09



User Reviews:

  • 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.




  • Copyright 2007 by Parallax, Inc.
    Please contact obex.support@parallax.com with comments or questions.