Shop OBEX P1 Docs P2 Docs Learn Events
SV: [basicstamps] Cyclocomputers + basic stamp — Parallax Forums

SV: [basicstamps] Cyclocomputers + basic stamp

ArchiverArchiver Posts: 46,084
edited 2003-10-15 08:57 in General Discussion
Greetings!

There's another problem with the BS2/cyclecomputer setup; that the BS2
doesn't have the accurate clock/interrupt needed for timing, and
therefore can't calculate the average.

If you add a RTC of some sort, then, yes it's doable.
But at the same time I suggest you just ditch the cyclecomputer and use
ONLY the BS2 with a LCD screen. (Wasn't there a thread on small LCD's a
few days ago?)

I once did something similar with a Psion Organiser II, running OPL and
a few chips.
(The Organiser uses a .9MHz clock, and OPL is 'semi-interpreted' so
isn't much faster)
I had to add a couple of assembly language routines, though, since OPL
didn't give me the low-level access I needed(but which PBASIC gives on
the BS2)

I had no problems displaying Speed, Distance, Travel Time, Clock,
Average, Last minute average, or anything else that took my fancy. (With
lots of time to spare :-)

You can find the schematics(the counter circuits can be helpful in your
case) and program here:
http://home.c2i.net/trygveh/english/download/org2/t2bike.html

The 74HC244 and the AND circuits is not necessary when using a BS2,
though.

The OPL syntax may look weird, but what it boils down to is:

Wait for system tick (Read RTC, or use one that sets a Pin
high/low)
Store old counter value
Read counter
find differences between them, taking in consideration
'rollover'
Calculate distance and time. (Distance is stored as counter
ticks, NOT feet, furlongs, Kilometers, Miles or whatever. )
Display values
Repeat....

Note: To make the Last minute average, I stored the last 60 readings in
RAM and added them together to find the total counter increments for the
last minute. This trick is best done on a BS2 model with a scratchpad
RAM. (You could seriously reduce the lifespan of the Program memory of
the BS2 if you store it in Program space)

:-)
Trygve


Opprinnelig melding
Fra: Tim Hart [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=V0fboAd7XYAi7qUvh2K9O8WiSDBOYZNA4GYVSlZAaEHzqnoOiCcsE3yEWBVB3gXskxTT0LSCctDTWTdpjA]tim.hart@h...[/url
Sendt: 14. oktober 2003 20:53
Til: basicstamps@yahoogroups.com
Emne: Re: [noparse][[/noparse]basicstamps] Cyclocomputers + basic stamp


It's one way my friend....the data goes in and never comes out.

But you could act as an "Man in the middle" and relay the info. The
sensor is a simple reed switch you could hook the stamp to it and with a
bit of math you could read the speed arcuately. Then because your in
the middle you could send the pulse up to the Speedometer and it should
work fine. You can even calibrate the Stamp via the Speedometer to make
sure they agree.

I'd bet the digital Speedometer is really a PIC with an LCD and a reed
relay for wheel speed. Pretty simple huh?

>>> usjongwon@y... 10/14/03 01:45PM >>>
Hi,

How do I get a connection a Cyclocomputers to basic
stamp to get average speed?

thank you,

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.


Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/




To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.


Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Sign In or Register to comment.