Subject:
|
Re: LED's
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Wed, 5 Apr 2000 14:33:36 GMT
|
Original-From:
|
Richard Drushel <drushel@{spamless}apk.net>
|
Viewed:
|
3069 times
|
| |
| |
[Derek Healy] spake unto the ether:
> Hi, could anyone tell me how I might light LED's in sequence so that they
> would simulate a rev counter of an automobile & to also simulate the speed
> counter.
This is just an idea skeleton, but not too hard to flesh out, if
you've worked with TTL. The Handy Board memory map maps some upper 32K
addresses to I/O "ports". Look at the schematic and you can see which
addresses generate which enable lines. Some are used already, but some
are free. Put an 8-bit latch on one of the output ports. Have your
software map whatever your actual speed values are from 0-7. Use this
0-7 value to set the highest bit and every one below it in the latch.
Attach LEDs to the latch outputs. If you do it right, you should get the
rising/falling bargraph effect you're looking for.
Numeric example: say your hardware returns a 16-bit unsigned
integer (range 0-65535). Divide 65536 into 8 equal parts so you know
where the threshold changes are: 0, 8192, 16384, 24567, 32768, 40960,
49152, and 57344. Read your speed value and use these thresholds to map
it to 0-7. Say the value was 22438; that maps to level 2. So, set bits
2, 1, and 0 at the memory address corresponding to your output latch.
The corresponding 3 LEDs should light. If the speed went up to 39345,
that's level 4, so set bits 4-0 in the output latch; if the speed fell to
4154, that's level 0, so set bit 0 in the output latch.
The actual hardware to do this can be easily reverse-engineered
from the Handy Board schematic, as Fred does exactly the same thing for
motor outputs; just drive LEDs instead of motors.
*Rich*
--
Richard F. Drushel, Ph.D. | "Aplysia californica" is your taxonomic
Department of Biology, Slug Division | nomenclature. / A slug, by any other
Case Western Reserve University | name, is still a slug by nature.
Cleveland, Ohio 44106-7080 U.S.A. | -- apologies to Data, "Ode to Spot"
|
|
Message is in Reply To:
| | LED's
|
| Hi, could anyone tell me how I might light LED's in sequence so that they would simulate a rev counter of an automobile & to also simulate the speed counter. I need to know how I might wire them up and how I might be able to program them using time (...) (25 years ago, 5-Apr-00, to lugnet.robotics.handyboard)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|