July 7, 2005, 12:14 pm
You'll have to do this yourself. Take each ASCII digit and convert it to
a number by subtracting 48 (I believe). Multiply that number by the
position it holds, IOW, 123: 1 is x100, 2 is X10 and 3 is X1.
A Byte variable is good to a max of 255, a Word variable is good to
65535.
DLC
: With a Pic processor and the PCW compiler, I know how to get a string
: input over serial, get_char(), and I know how to convert that string
: (ex. "23") into an integer. Is there anyway to do the same thing with a
: OOPic?
: Basically, I am looking for a way to read in a string from
: hyperterminal (the string will end when enter is hit) and convert that
: string into an integer for use within the OOPic. The $Str() function
: will convert an integer into a string, is an easy way to do the
: opposite?
: I have an OOPic B.2.2+.
: Thanks,
: Tim
--
============================================================================
* Dennis Clark dlc@frii.com www.techtoystoday.com *
* "Programming and Customizing the OOPic Microcontroller" Mcgraw-Hill 2003 *
============================================================================
Site Timeline
- » PC based robot design -- musings
- — Next thread in » General Robotics Forum
-

- » AAAI-05 student blog
- — Previous thread in » General Robotics Forum
-

- » evoMUSART 2013: First CFP (with correct dates)
- — Newest thread in » General Robotics Forum
-

- » Heat pump refrigerant change to R-22 substitute
- — The site's Newest Thread. Posted in » General Metalworking
-

- » DCC sound question
- — The site's Last Updated Thread. Posted in » Model Railroad Forum
-


