This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Tuesday, February 19, 2008

[oopic] Re: storing data to oopic

--- In oopic@yahoogroups.com, alvin sy <alvinsy2000@...> wrote:
>
> Sorry about that, i didnt know that yahoo dont allow
> attachment of files here. I already posted in the
> files section of the groups under Code Example folder,
> my folder name is "storing data from gps to oopic"
> sorry for the trouble... btw i was wondering my gps
> pins is already in TTL is the serialport object the
> right object to use?

It looks like you accumulate the ASCII digits ok although I don't
understand why you are skipping the least significant fractional
digit in order to keep the most significant non-fractional digit.
Still, it's your choice...

I think the conversion of the string to a value is hosed. It should
go something like:

val = 0
for i = 1 to 5
val = (10 * val) + (array(i) - '0')
next i

And that 47 and 58 stuff? You should really use an ASCII literal so
the code is clear.

The idea of the state machine is correct, you only want to deal with
one char at a time. Personally, I would build a loop to accumulate
and convert on the fly rather than store the chars in an array.

It isn't the oSerialPort object that determines the pin electrical
specification but it is TTL compatible, more or less. There is
always something of a concern mixing TTL and CMOS in terms of logic
voltage thresholds. Still, it should work ok. If not, add a couple
of 10k pull-up resistors.

Richard



Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

No comments: