Shop OBEX P1 Docs P2 Docs Learn Events
Penguin English — Parallax Forums

Penguin English

HumanoidoHumanoido Posts: 5,770
edited 2011-02-25 00:28 in Robotics
Penguin English REV B
This program enables Penguin robot to recite English letters
including all consonants and vowels by displaying the results on
the 7-segment display. The Debug screen will show the letter,
decimal, hex and binary values!
' Title      Penguin B English
' Code Name  penguinb_english1.2.bpx
' Author     Humanoido
' Purpose    Penguin B Recites English Letters
' Version    1.2
' Begin      10 February 2010
' Update     23 February 2011, 23 March 2010
' Hardware   Parallax Stock Penguin REV B BOARD
' Contact    penguin(dot)robot(@)yahoo(dot)com
'
' DIRECTORY
' ---------
' PENGUIN RESOURCES
' OVERVIEW
' PENGUIN ENGLISH 101
' THEORY
' THE PROGRAM
' MAKING A FONT & CONVERSION CHART
' NUMBERS
' PENGUIN ENGLISH FONT
' PROGRAMMING
' REVISION BOARDS
' BOARD DISPLAY CAPABILITIES
' DRIVING A SEGMENT FONT
' CREATING LETTERS & CHARACTERS
' FONT LIMITATIONS
' PENGUIN FONT DERIVATIONS
' MATH & SPECIAL CHARACTERS
' LED SEGMENTS IDENTIFICATION CHART
' SEGMENT DISPLAY ILLUSTRATION
' SEGMENT POSITIONING $ BYTE ARRANGEMENT
' PROGRAMMING FORM, DP, BIT NOTATION
'
'
' OVERVIEW
' ------------
' About a year ago, I contacted Ken Gracey of Parallax and suggested
' upgrades to Penguin - mainly to gain an extra port and enable greater
' display capability, using a shift register. This small integrated
' circuit chip is most noted for expanding outputs. It was an idea
' well received!
'
'
' THEORY
' ------
' The idea was to control the seven segment display with just three lines
' instead of four, using the 74HC595 "serial in parallel out" shift register.
' I'm happy to say the idea has come to frution. The 74HC595 design converts
' a synchronous serial data stream to eight parallel outputs, namely seven
' segments and one decimal point.
'
'
' THE PROGRAM
' -----------
' The program has all the tools necessary to display English letters.
' It calculates and displays the ascii, decimal, hex, and binary in
' chart form on the Debug screen.
'
' This is handy if you prefer to work with decimals instead
' of binary numbers, etc. The code comments simplify the method for making
' additional characters using the Binary number approach.
'
'
' MAKING A FONT & CONVERSION CHART
' --------------------------------
' The code is written so a Font and Conversion Chart can be created. Just
' run the program and push pause when it completes the Z line. Now use your
' favorite screen capture program and snap a photo of the chart on the
' Debug screen.
'
'
' NUMBERS
' -------
' Numbers are inclued with this code. Remove the REMs if you want to display
' all the numbers and the decimal point. See other Humanoido programs
' for Penguin to show Penguin Font, create text numbers, special English
' punctuation, math and graphic characters.
'
'
' PENGUIN ENGLISH FONT
' --------------------
' To create English text letters, first a Penguin font is created.
' The font style best represents letters on the 7-segment display.
' To minimize redundancy and maximize recognition, there is a mix of
' case. The Penguin font is not upper or lower case specific.
'
'
' PROGRAMMING
' -----------
' The synchronous serial data has components to program, mainly the serial
' data and the serial clock. The SHIFOUT command is chosen to handle these
' details and write data to the synchronous chip. After the shifting process,
' the data must be latched to the outputs by momentarily pulsing the Latch
' control line. This will stabilize the outputs as new data is shifted in,
' and is accomplished with a PULSOUT statement. Shiftout is LSB least
' significant bit first.
'
'
' REVISION BOARDS
' ---------------
' Revison B boards use a 74HC595 shift register to control the segment display.
' This requires only three pins instead of four, and gives Penguin the use of
' an extra port (located behind the display).
'
'
' BOARD DISPLAY CAPABILITIES
' --------------------------
' Rev A boards could only display numbers 0 through 9 and five graphic characters.
' The DP was dead.

' Rev B boards enable the display of numbers 0 through 9, the entire English
' alphabet with a special font, and dozens of graphics combinations and the DP
' is alive. Using this program, it's now possible for Penguin to output text
' sentences on the segment display for "talk."
'
'
' DERIVING A SEGMENT FONT
' -----------------------
' The easy way to create fonts is to make a segment font that fits Pengin's
' segment display. To create English text letters, first a Penguin font is
' created. The font style best represents letters on the 7-segment display.
' To minimize redundancy and maximize recognition, there is a mix of
' case. The Penguin font is not case sensitive.
'
'
' CREATING LETTERS & CHARACTERS
' -----------------------------
' Letters & characters are created with a binary lookup table. Copy the form
' and change the 0s into 1s for the segments to turn off. The code is sent
' to the 74HC595 shift register and sets the display segments. The program is
' written in binary as it can correspond readily to a visual representation.
Sign In or Register to comment.