Shop OBEX P1 Docs P2 Docs Learn Events
PENGUIN ROBOT Virtual 2-Digit Display - the Code — Parallax Forums

PENGUIN ROBOT Virtual 2-Digit Display - the Code

HumanoidoHumanoido Posts: 5,770
edited 2007-09-23 11:17 in Robotics
Attached is code for a program that converts
Penguin robots' 1 digit display into a VR Virtual
2-Digit Display.

It can count 2 digit numbers, like 12 for example,
on the one digit display. How does it work?
The techniques are code timing and persistence
of vision.

This code greatly expands the numeric display
capability of Penguin. VR instrumentation is
widely used in the Space Program, and in
NASAs' Space Shuttle. Here, we tap into this
technology and tiny Penguin reaps the
benefits!

penguin_2digit_display.bpx

humanoido

' BACKGROUND
' ----------
' Stock Penguin has a one digit display. Once you count from zero to
' to nine - it won't go any higher. However, in the real world, there
' are many applications that use two digit numbers. It's much
' more useful to count from 0 TO 99 than from 0 TO 9.

' OPERATION
' ---------
' This program will convert Penguins 1-digit display into a 2-digit
' display. This is a fully functional VR Virtual Display that counts
' two digit numbers from 10 TO 19. To accomplish this small miracle,
' the code uses timing and persistence of vision.

' DROP-IN CODE
' ------------
' This drop in code has a dual nature.
' 1) it runs stand alone
' 2) it can drop into your own code as a subroutine
' This is so your own programs can have the full functions of a two
' digit display.

' DEBUGGING
' ---------
' It's now possible to run applications reporting debug numbers
' without a computer connected. Just insert representative numbers
' for output to the virtual display from 0 to 19.
'
' TYPICAL REPRESENTATIONS
' -----------------------
' Typical numerical displays can include counting, timing, cardinal
' directions, pulse output, baud information, frequencies,
' intensities, program numbers, steps, light levels, IR data,
' speaker volumes, program subroutines, special functions,
' ultrasonic ranges, obstacle conditions, cartographic positioning,
' bumper conditions, language reporting in base ten, input and
' output states, servo cycles, motion range reporting, remote codes,
' radio bands, Penguinese vocabularies, lexicons, changes of state
' and conditions, surveillance reporting, tune & music sequences,
' and switch conditions.

' EXPANDING
' ---------
' Write a routine to display numbers 0 to 9 at the beginning of this
' code. Hint: take a look at penguin_tiny_timer.bpx for the entire
' code as the answer!

' COUNTING HIGHER
' ---------------
' The code to count higher from 0 to 100 is made available with the
' 3-digit VR Virtual Display available in the penguin_code_name.bpx
' programming suite. Many developed Penguin robot applications count
' numbers under 101, so both programs are very useful.

Post Edited (humanoido) : 9/23/2007 11:30:25 AM GMT

Comments

  • slashsplatslashsplat Posts: 63
    edited 2007-09-23 00:46
    Totally cool.

    Now what about using the left column of vertical LEDS for the "1" so the number looks like it is being "written" from the left to the right? humanoido, have you been writing in Hebrew or Chinese for too long? smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    slashsplat
    /* Ira Chandler */
    BotConnect.com
  • HumanoidoHumanoido Posts: 5,770
    edited 2007-09-23 11:17
    Slashsplat,

    Nice idea for a seven segment LED display wired to ports.
    However, with Penguin, the wiring goes directly to the
    SN74LS47NSR chip. This is a binary coded decimal to
    seven segment decoder driver integrated circuit.

    focus.ti.com/lit/ds/symlink/sn74ls47.pdf
    www.parallax.com/dl/docs/prod/robo/27313-6%20PenguinDoc-v1.0.pdf

    This reduces the number of required of display outputs
    down to only four. It was a brilliant move on the part
    of Parallax to come up with a design reducing the
    number of required ports. In the process, programming
    control of the individual segments is lost. This results in
    capability to display the digits 0 through 9 and five
    special characters, none of which solely line up in the
    singular left vertical column.

    humanoido
Sign In or Register to comment.