SX Video Display Module Hitt Consulting

Similar documents
SX Video OSD Module Hitt Consulting

HC-OSD Video OSD Module

with Carrier Board OSD-232+ TM Version 1.01 On-screen composite video character and graphic overlay Copyright 2010 Intuitive Circuits, LLC

TV Character Generator

VideoStamp 8 TM. Eight channel on-screen composite video character and graphic overlay with real-time clock. Version 1.01

Writing Programs INTRODUCING THE BASIC STAMP EDITOR 2 SCRIBBLER HARDWARE PROGRAMMING CONNECTIONS 8 BLINKING THE LIGHTS WITH PROGRAM LOOPS 9

Ocean Sensor Systems, Inc. Wave Staff III, OSSI With 0-5V & RS232 Output and A Self Grounding Coaxial Staff

ZU 251. Incremental Counter Module With Analogue Output and Serial Interface. Operating Instructions. control motion interface

Kramer Electronics, Ltd. USER MANUAL. Model: FC Analog Video to SDI Converter

Vorne Industries. 87/719 Analog Input Module User's Manual Industrial Drive Itasca, IL (630) Telefax (630)

Intelligent Security and Fire Ltd

DiD. LCD Video Monitor & Video Wall Universal User Manual. Digital Information Display

HD-SDI Express User Training. J.Egri 4/09 1

HomeVision-PC Owner s Manual Version 2.62

VM15 Streamer V User s Guide

SXGA096 DESIGN REFERENCE BOARD

ZU 252. Incremental Counter Module With Analogue Output and Serial Interface. Operating Instructions. control motion interface

Programmable Video Signal Generator VG-880. Instruction Manual. Ver 1.10

Ocean Sensor Systems, Inc. Wave Staff, OSSI F, Water Level Sensor With 0-5V, RS232 & Alarm Outputs, 1 to 20 Meter Staff

Operating Manual. 50mW C-Band EDFA with GPIB and RS232 Interface

QTI Line Follower AppKit for the Boe-Bot (#28108)

Manual Version Ver 1.0

SPI Serial Communication and Nokia 5110 LCD Screen

Lecture 14: Computer Peripherals

DC-105 Quick Installation Guide

Lab 3 LCD Mar

Kramer Electronics, Ltd. USER MANUAL. Model: VS-201YC. 2x1 s-video Switcher

4 x 4 VGA Matrix Switch

REVISIONS LTR DESCRIPTION DATE APPROVED - Initial Release 11/5/07 MDB A ECR /9/08 MDB

Table of Contents Introduction

IV 251. Signal Converter SSI Analogue and SSI Serial. Operating Instructions. control motion interface

MENU EXECUTE Shiloh Road Alpharetta, Georgia (770) FAX (770) Toll Free

DIVERSITY DVB-T RECEIVER (DDR)

MENU EXECUTE Shiloh Road Alpharetta, Georgia (770) FAX (770) Toll Free

MENU EXECUTE Shiloh Road Alpharetta, Georgia (770) FAX (770) Toll Free

AC335A. VGA-Video Ultimate Plus BLACK BOX Back Panel View. Remote Control. Side View MOUSE DC IN OVERLAY

Model 1476-C SuperQuad HR

SignalTap Plus System Analyzer

Technovision DV-66B User Guide (HW V1.3, FW V1.6) Latest Version Sept. 2004

medlab One Channel ECG OEM Module EG 01000

Video Scaler Pro with RS-232

HD VIDEO COMMUNICATION SYSTEM PCS-XG100/XG77. System Integration Manual Sony Corporation

Bel 2120B. Analogue/AES/SDI Shuffler. User s Guide Version /05/04

VNS2210 Amplifier & Controller Installation Guide

EXTERNAL CONTROL THROUGH RS-232C

IV 251. Signal Converter SSI => Analogue and SSI => Serial. Operating Instructions. control motion interface

Foreword: The purpose of this document is to describe how to install and configure Neets 4 relay box

FRQM-2 Frequency Counter & RF Multimeter

DXI SAC Software: Configuring a CCTV Switcher. Table of Contents

MENU EXECUTE Shiloh Road Alpharetta, Georgia (770) FAX (770) Toll Free

Instruction Manual Model Downconverter

AC334A. VGA-Video Ultimate BLACK BOX Remote Control. Back Panel View. Side View MOUSE DC IN BLACK BOX ZOOM/FREEZE POWER

308 Industrial Park Rd. Starkville, MS RC1-Y Controller. For Yeasu DC Rotators INSTRUCTION MANUAL. Copyright 2015, All Rights Reserved.

MONITOR POWER Shiloh Road Alpharetta, Georgia (770) FAX (770) Toll Free

Laboratory 4 Check Off Sheet. Student Name: Staff Member Signature/Date: Part A: VGA Interface You must show a TA the following for check off:

QRF5000 MDU ENCODER. Data Sheet

3-in 1- out DVI Switcher

EEG CB1512 Caption Legalizer & Relocating Bridge

Hardware & software Specifications

SPECIFICATION FOR APPROVAL

The characteristics of a video signal and methods to overcome distance limitations

Laboratory 4 Check Off Sheet. Student Name: Staff Member Signature/Date: Part A: VGA Interface You must show a TA the following for check off:

Mounting Dimensions / Viewing 2 Mounting Options 3. Wiring Configuration 4. Quick Set up Procedure 5. Changing Intensity 6.

ET-YFB100G S P E C F I L E. Digital Interface Box. As of December Specifications and appearance are subject to change without notice.

VGA Port. Chapter 5. Pin 5 Pin 10. Pin 1. Pin 6. Pin 11. Pin 15. DB15 VGA Connector (front view) DB15 Connector. Red (R12) Green (T12) Blue (R11)

DUAL/QUAD DISPLAY CONTROLLER Operation Manual

NS-3 RF Noise Source Operation Manual

APPLICATION NOTE # Monitoring DTMF Digits Transmitted by a Phone

TView QuadScan USER S MANUAL Revision 2.00

For warranty service, please contact Microframe at: A technician will gladly assist you.

This document describes the different ways to allow the automation system to close a gpi contact from the transmission list.

Installation Manual VS-1200-KW1. Frequency Domain Scrambler with Multi-Format ANI VS-110- KW1. Rolling Double Inversion Scrambler VS KW1

Operating Instructions Rev. No. 4.1 July 07, LTC and VITC Reader with Serial Interface TC 60 RLV

Think Outside the Box... DIDO JR. Applications and Video Wall System Wiring Diagrams

Kramer Electronics, Ltd. USER MANUAL. Model: VS x 1 Sequential Video Audio Switcher

Configuring the Élan SC300 Device s Internal CGA Controller for a Specific LCD Panel

BecauseRFL andhubbel haveapolicyofcontinuousproductimprovement,wereservetherighttochangedesignsandspecificationswithoutnotice.

User Guide & Reference Manual

OTM FREQUENCY AGILE 750MHz F.C.C. COMPATIBLE TELEVISION MODULATOR INSTRUCTION MANUAL

Command line direct mode: This is relevant when a PC application is used to send and receive commands over the network port.

J.M. Stewart Corporation 2201 Cantu Ct., Suite 218 Sarasota, FL Stewartsigns.com

MICROTRONIX DX-2200 DUAL-VIEW 2X1 SDI VIDEO SWITCHER

N3ZI Digital Dial Manual For kit with Backlit LCD Rev 4.00 Jan 2013 PCB

CP-255ID Multi-Format to DVI Scaler

QUADRANT DVB-T Modulator USER GUIDE. Quadrant DVB A N T E N N A I R. Copyright 2012 Antennair Limited, Neo House, Shaw Road, OLDHAM OL1 4AW. Issue 1.

RC1-G Series Controller

SG-6005xl & SG-6006 PROTOCOL (VER 1.2)

LAX_x Logic Analyzer

Working with CSWin32 Software

DeviceConfig. User Guide. Camera configuration tool (RS232, GigE, Camera Link) V April 2012

Project Final Report. Z8 Arcade! 4/25/2006 James Bromwell,

SigPlay User s Guide

O P E R A T I O N M A N U A L. RF-Reader. Stand-alone-Reader Leser 2plus with RS-232 interface

Introduction to LasrPlay and DVDplay Synchronizers

Jinyoung Contech Co., Ltd.

Aurora Grid-Tie Installation Instructions (Model Number: PVI-3.0-OUTD-US-W) Revision 4.1

A BBD replacement and adjustment procedure

Dual PAL or NTSC Video to RGB Converter (One way) with 12V Relay Switch Operation Manual

N3ZI Digital Dial Manual For kit with Serial LCD Rev 3.04 Aug 2012

Kramer Electronics, Ltd. USER MANUAL. Model: VS-401YC. 4x1 s-video / Audio Switcher - DA

Transcription:

SX Video Display Module Hitt Consulting Rev F Firmware Rev F * Serial In Video Out 105 S Locust Street * 4800 baud serial input (8N1) Shiremanstown Pa 17011 * NTSC or PAL monochrome video output info@hittconsulting.com * 6 x 16 characters / 12 x 32 pixels www.hittconsulting.com * Audio Output

SX VIDEO DISPLAY MODULE The Null (128) value is useful to send at startup just in case a multi-byte command (like CrsrXY) was send without the parameters. The next values sent would then be interpreted as the parameters for the CrsrXY command, instead of the commands intended. The Null value is simply ignored if received on it s own. AUDIO / VIDEO OUTPUTS The video output must be connected to a video input. This is usually a yellow colored RCA jack on a TV, monitor, VCR or DVD player. Video inputs have an impedance of about 75 ohms, and this is needed to get the correct voltage from the module. OVERVIEW The SX Video Display Module is used to create text and low-resolution graphics on a TV or video monitor. Popular uses include: simple games, status displays and demonstrations. The video module creates a display of 6 lines each consisting of 16 characters. Each character is 8 pixels wide and 8 pixels high. The module accepts serial data at 4800 baud or 480 characters per second. An entire screen of 96 characters takes only 1/5 of a second. This makes games and rapidly updating display possible. SERIAL DATA FORMAT The serial data is received at a baud rate of 4800 8N1. Character data is sent using standard ASCII codes. In other words on the Basic Stamp microntrollers a simple message might be: SEROUT SPin,Baud,[ Hello ] Also pixels (1/4 character size) can be turned on or off with the special plot and unplot serial commands. You only need to specify the location of the pixel on the screen. The audio output has a level of about 0.21volts peak-to-peak. It is meant to be connected to the (usually white colored) audio input of a TV, VCR or DVD player. OPTION SWITCHES There are two switches on the board. The first one determines if the video output will be NTSC (U.S.A.) or PAL (U.K.). The second switch determines if the serial input is an inverted or a true serial input. Serial input is always 4800 8N1 format. ON-BOARD VOLTAGE REGULATOR There is also an on-board voltage regulator. You can connect the +5 pin to a regulated 5 volt supply, or you can connect the Vin pin to a 6volt to 12volt supply. The module requires about 35 milliamps. DIGITAL OUTPUTS Eight of the SX pins are brought out and the command VidOuts (134) is used to set the output states. This gives you eight additional output that can be used for other purposes. These really come in handy if the module is receiving data from a wireless receiver. The output pins are set by sending the serial command VidOuts (134) followed by the value you want on the output pins. SEROUT Spin,Baud,[v_PlotXY, X, Y] COMMANDS Received data values from 16 to 127 and 144 to 255 are display characters. Values from 0 to 15 and 128 to 143 are commands. Some commands require additional data that is send immediately following the command. For example the CrsrXY command must be followed by the X value then the Y value. Commands for values from 0 to 15 are the same as the DEBUG commands for the Basic Stamps, and the constants for DEBUG can be used.

Power: Size: Controller: Display: Characters: SPECS +5VDC or +6 to 9VDC 35mA 2.0 x 1.5 (not including connectors) Ubicom SX28AC/DP microcontroller operating at 20 MHz. 6 lines of 16 characters each NTSC (USA) or PAL (UK) output 224 including upper & lower case and inverse Serial Input to module that accepts serial data at 4800 baud, 8 data bits, 1 stop bit and no parity (4800-8N1). Depending on the setting of the INV/TRUE jumper will determine if the serial data must be inverted or true. The default setting is inverted which will be the case if the serial data is coming from a PC serial port. When sending data from the basic stamp, make sure the format matches the jumper setting. Gnd Power supply ground. This MUST also be connected to ground on the device sending the serial data to the module. Graphics: Audio: CN1 CN2 Vin 32 horizontal, 12 vertical 1/4 character blocks 255 Tones, 255 Durations SPECIAL FEATURES * Low Res graphics plot and unplot commands * Invert Screen command * 8 Digital Outputs (20ma total current) * No delays needed when sending data PIN FUNCTIONS Yellow RCA jack. This is the video output from the module. Connect this to the video input of your video display using an RCA cable. White RCA jack. This is the audio output from the module. Connect this to the audio input of your video display device (if desired). The signal level is about 0.21volts. Supply voltage input to regulator. Vin may be between 6 volts and 9 volts. This source must be able to supply 50 milliamps of current. +5 Regulated 5 volt supply voltage input to module. This voltage MUST be regulated to 5 volts and be able to supply 40 milliamps of current. If you are using Vin to supply power to the module, this pin can supply small amounts of power to other devices. Do not draw more than 20mA from this pin. Out.0 Additional output pins. These pins are set by Thru using the VidOuts (134) Command. This is Out.7 similar to setting output pins on the BS2. Do not draw more than 20mA from each pin, or 50mA from all pins combined. Out.0 has a binary value of 1, Out.1=2, Out.2=4, Out.3=8, Out.4=16, Out.5=32, Out.6=64, Out.7=128. Simply add the values of the pins you want on (+5) and send that value to the module after the VidOuts (134) command. For example to set all the pins high (+5) send 134 then 255, to set all the pin low (0), send 134 then 0. SOUND COMMAND DETAILS The SOUND command will generate a tone with a frequency of (7622/tone)Hz for a duration of (17.2*duration)ms. The module will continue to accept and display characters while the sound is being generated. If another SOUND command is issued before the previous SOUND command is finished, the new tone will start immediately. Any tone with a duration of zero will immediately stop any sound in progress. Note that the BELL command is the same as SOUND 5,10. Therefore it will generate a frequency of (7622/5)=1524Hz for a duration of (17.2*10) = 172milliseconds. Firmware updates, demo programs and additional info can be found on the website www.sxvm.com

COMMANDS Commands from 0 to 15 are the same as the Basic Stamp(R) DEBUG commands. VALUE NAME PARAMETERS DESCRIPTION 0 Cls (none) Clears the screen and moves cursor to 0,0 1 Home (none) Moves cursor to 0,0 2 CrsrXY (2) X,Y Moves cursor to specified coordinates 3 CrsrLf (none) Moves cursor 1 position to the left 4 CrsrRt (none) Moves cursor 1 position to the right 5 CrsrUp (none) Moves cursor 1 position upward 6 CrsrDn (none) Moves cursor 1 position downward 7 Bell (none) Creates a 1.5Khz tone for 170mSecs 8 Bksp (none) Moves cursor 1 position to the left (destructive) 9 Tab (none) Moves cursor to next tab stop (0,4,8,12) 10 Lf (none) Linefeed; Moves cursor down 1 line 11 ClrEol (none) Clears from cursor to end-of-line 12 ClrDn (none) Clears from cursor to end-of-screen 13 Cr (none) Carriage Return; Moves cursor to start of next line 14 CrsrX (1) X Moves cursor to specified column 15 CrsrY (1) Y Moves cursor to specified row 128 Null (none) Ignored 129 InvOn (none) Turns on inverse mode 130 InvOff (none) Turns off inverse mode 131 InvScrn (none) Inverts the whole screen 132 PlotXY (2) X,Y Plots a point(1/4 char) at X,Y 133 UnPlotXY (2) X,Y Unplots a point(1/4 char) at X,Y 134 VidOuts (1) Value Sets the modules output pins 135 VidVer (none) Displays the firmware version letter 136 DecByte (1) Value Displays the next value in decimal 137 HexByte (1) Value Displays the next value in hexadecimal 138 Sound (2) Pitch,Duration Creates an audio tone of Pitch,Duration 139 --- [ RESERVED ] 140 --- [ RESERVED ] 141 --- [ RESERVED ] 142 --- [ RESERVED ] 143 --- [ RESERVED ]

16 CHARACTER SET (+128 for Inverse) +0 +1 +2 +3 +4 +5 +6 +7 24 32 40 48 56 64 72 80 88 96 104 112 120

Basic Stamp Example Programs =========================================== File... Video AllChars.BS2 Purpose... Demo the SX-Video Module Author... Terry Hitt E-mail... terry@hittconsulting.com Started... Mar 4, 2005 =========================================== Stamp to Video Module Connections BS2 Video Module --- ------------- P0 ----- Serial GND ----- Gnd {$STAMP BS2} {$PBASIC 2.5} #SELECT $STAMP #CASE BS2, BS2E, BS2PE T1200 CON 813 T2400 CON 396 T4800 CON 188 T9600 CON 84 T19K2 CON 32 T38K4 CON 6 #CASE BS2SX, BS2P T1200 CON 2063 T2400 CON 1021 T4800 CON 500 T9600 CON 240 T19K2 CON 110 T38K4 CON 45 #ENDSELECT SevenBit CON $2000 Inverted CON $4000 Open CON $8000 Video commands v_null CON 128 v_invon CON 129 v_invoff CON 130 v_invscrn CON 131 v_plotxy CON 132 v_unplotxy CON 133 v_outs CON 134 v_version CON 135 v_decbyte CON 136 v_hexbyte CON 137 Baud CON T4800 + Inverted Sout PIN 0 Cnt VAR Word Start: OUTPUT Sout PAUSE 100 SEROUT Sout,baud,[v_Null, v_null, v_null,cls] Again: FOR Cnt=16 TO 127 SEROUT Sout,baud,[v_DecByte,Cnt," = ",Cnt," ",v_decbyte,(cnt+128)," = ",(Cnt+128),CR] PAUSE 250 NEXT GOTO Again End of program listing =========================================== File... Lab Simulation.BS2 Purpose... Demo the SX-Video Module Author... Terry Hitt E-mail... terry@hittconsulting.com Started... Mar 4, 2005 =========================================== Stamp to Video Module Connections BS2 Video Module --- ------------- P0 ----- Serial GND ----- Gnd {$STAMP BS2} {$PBASIC 2.5} #SELECT $STAMP #CASE BS2, BS2E, BS2PE T1200 CON 813 T2400 CON 396 T4800 CON 188 T9600 CON 84 T19K2 CON 32 T38K4 CON 6 #CASE BS2SX, BS2P T1200 CON 2063 T2400 CON 1021 T4800 CON 500 T9600 CON 240 T19K2 CON 110 T38K4 CON 45 #ENDSELECT SevenBit CON $2000 Inverted CON $4000 Open CON $8000 Video commands v_null CON 128 v_invon CON 129 v_invoff CON 130 v_invscrn CON 131 v_plotxy CON 132 v_unplotxy CON 133 v_outs CON 134 v_version CON 135 v_decbyte CON 136 v_hexbyte CON 137 v_ohms CON 30 Baud CON T4800 + Inverted Sout PIN 0 R VAR Word Volts VAR Word MilliVolts VAR Word MilliAmps VAR Word TemperatureW VAR Word TemperatureF VAR Word Relay1 VAR Bit Relay2 VAR Bit Relay3 VAR Bit PAUSE 100 SEROUT Sout,baud,[v_Null,v_Null,v_Null,CLS, v_invoff] SEROUT Sout,baud,["Lab Simulation", CR] PAUSE 3000 SEROUT Sout,baud,[CLS] Volts=5 MilliVolts=0

MilliAmps=100 TemperatureW=25 TemperatureF=0 Relay1=1 Relay2=0 Relay3=1 Start: SEROUT Sout,baud,[HOME, "Volts: ", DEC1 Volts, ".", DEC3 MilliVolts, CR] SEROUT Sout,baud,["Amps: 0.", DEC3 MilliAmps, CR] SEROUT Sout,baud,["Temp: ", DEC2 TemperatureW, ".", DEC2 TemperatureF, v_ohms, "C", CR] SEROUT Sout,baud,["Relay1: "] IF Relay1=1 THEN SEROUT Sout,baud,["ON ",CR] ELSE SEROUT Sout,baud,[v_InvOn,"OFF",v_InvOff,CR] SEROUT Sout,baud,["Relay2: "] IF Relay2=1 THEN SEROUT Sout,baud,["ON ",CR] ELSE SEROUT Sout,baud,[v_InvOn,"OFF",v_InvOff,CR] SEROUT Sout,baud,["Relay3: "] IF Relay3=1 THEN SEROUT Sout,baud,["ON ",CR] ELSE SEROUT Sout,baud,[v_InvOn,"OFF",v_InvOff,CR] PAUSE 250 Update 4 times a second Simulate changes to parameters IF R < 16384 THEN MilliVolts=MilliVolts+2 IF MilliVolts > 999 THEN MilliVolts=MilliVolts-1000 Volts=Volts+1 IF r > 49152 THEN IF MilliVolts < 2 THEN Volts=Volts-1 MilliVolts=MilliVolts+1000 MilliVolts=MilliVolts-2 IF R < 16384 THEN MilliAmps=MilliAmps+1 IF R > 49152 THEN MilliAmps=MilliAmps-1 IF R < 16384 THEN TemperatureF=TemperatureF+1 IF TemperatureF > 99 THEN TemperatureF=TemperatureF-100 TemperatureW=TemperatureW+1 IF r > 49152 THEN IF TemperatureF < 1 THEN TemperatureW=TemperatureW-1 TemperatureF=TemperatureF+100 TemperatureF=TemperatureF-1 IF R < 4096 THEN Relay1=~Relay1 IF R < 4096 THEN Relay2=~Relay2 IF R < 4096 THEN Relay3=~Relay3 GOTO Start End of program listing =========================================== File... Pong1.BS2 Purpose... Demo the SX-Video Module Author... Terry Hitt E-mail... terry@hittconsulting.com Started... Mar 14, 2005 =========================================== Stamp to button connections --------------------------- 4.7K Player1Down P1 -+-/\/\/\-- Vdd +---_\---- GND Button 4.7K Player1Up P2 -+-/\/\/\-- Vdd +---_\---- GND Button Stamp to Video Module Connections BS2 Video Module --- ------------- P0 ----- Serial GND ----- Gnd {$STAMP BS2} {$PBASIC 2.5} #SELECT $STAMP #CASE BS2, BS2E, BS2PE T1200 CON 813 T2400 CON 396 T4800 CON 188 T9600 CON 84 T19K2 CON 32 T38K4 CON 6 #CASE BS2SX, BS2P T1200 CON 2063 T2400 CON 1021 T4800 CON 500 T9600 CON 240 T19K2 CON 110 T38K4 CON 45 #ENDSELECT SevenBit CON $2000 Inverted CON $4000 Open CON $8000 Video commands v_null CON 128 v_invon CON 129 v_invoff CON 130 v_invscrn CON 131 v_plotxy CON 132 v_unplotxy CON 133 v_outs CON 134 v_version CON 135 v_decbyte CON 136 v_hexbyte CON 137 Baud CON T4800 + Inverted Sout PIN 0 Player1Dn PIN 1 Player1Up PIN 2 BallX VAR Byte BallY VAR Byte BallLastX VAR Byte BallLastY VAR Byte BallDirX VAR Byte BallDirY VAR Byte Player1 VAR Byte Delay VAR Byte Score VAR Byte Balls VAR Byte

GOTO Start BallFlash: SEROUT Sout,baud,[CRSRXY, 4, 1, "Score:", DEC Score, CRSRXY, 4, 4, "Balls:", DEC Balls] BallLastX=(BallX-10)/2 BallLastY=(BallY-10)/2 FOR Delay=1 TO 3 SEROUT Sout,baud,[v_PlotXY, BallLastX, BallLastY] PAUSE 300 SEROUT Sout,baud,[v_UnPlotXY, BallLastX, BallLastY] PAUSE 300 NEXT BallX=15*2+10 BallY=5*2+10 BallLastX=(BallX-10)/2 BallLastY=(BallY-10)/2 BallDirX=1 BallDirY=1 SEROUT Sout,baud,[CRSRXY, 4, 1, " ", CRSRXY, 4, 4, " "] Erase text RETURN Start: Score=0 Balls=3 PAUSE 100 SEROUT Sout,baud,[v_Null,v_Null,v_Null,v_Null, v_invoff,cls] SEROUT Sout,baud,[CRSRXY, 1, 1, v_invon, "Hitt Consulting", CRSRXY, 4, 2, v_invoff, "SX-Video", CRSRXY, 5, 3, v_invon, "Module", CRSRXY, 6, 5, v_invoff, "Pong1"] PAUSE 5000 SEROUT Sout,baud,[CLS] FOR BallX=1 TO 31 SEROUT Sout,baud,[v_PlotXY, BallX, 0, v_plotxy,ballx, 11] IF BallX < 12 THEN SEROUT Sout,baud,[v_PlotXY, 31, BallX] NEXT Player1=5 FOR BallY=5 TO 6 SEROUT Sout,baud,[v_PlotXY, 0, BallY, v_plotxy, 31, BallY] NEXT BallX=15*2+10 BallY=5*2+10 GOSUB BallFlash BallLastY=(BallY-10)/2 Check if ball is at far left IF BallX < 12 THEN Check if player1 paddle is in position IF (Player1=(BallY-10)/2) OR (Player1=(BallY- 10)/2-1) THEN Yes, Player1 hit ball SEROUT Sout,baud,[BELL] Score=Score + 1 BallDirX=-BallDirX BallX=BallX+BallDirX BallLastX=15 ELSE Player1 missed Balls=Balls-1 GOSUB BallFlash Flash ball at missed location IF Balls=0 THEN GOTO Start GOSUB BallFlash Flash ball to start location Check if ball hit back wall IF BallX > 72 THEN SEROUT Sout,baud,[BELL] BallDirX=-BallDirX BallX=BallX+BallDirX BallLastX=15 Check if ball hit top or bottom IF (BallY < 12) OR (BallY > 30) THEN Yes, make ball bounce SEROUT Sout,baud,[BELL] BallDirY=-BallDirY BallY=BallY+BallDirY BallLastX=(BallX-10)/2 BallLastY=(BallY-10)/2 Update ball position BallX=BallX+BallDirX BallY=BallY+BallDirY GOTO Main End of program listing Main: Delay=0 Check if player1 is trying to move up IF (Player1Up = 0) AND (Player1 > 0) THEN Player1=Player1-1 SEROUT Sout,baud,[v_UnPlotXY, 0, Player1+2, v_plotxy, 0, Player1] Delay=Delay+10 Check if player1 is trying to move down IF (Player1Dn = 0) AND (Player1 < 10) THEN Player1=Player1+1 SEROUT Sout,baud,[v_UnPlotXY, 0, Player1-1, v_plotxy, 0, Player1+1] Delay=Delay+10 Game delay IF Delay < 20 THEN PAUSE 20-delay Move ball on screen IF BallLastX <> 31 THEN SEROUT Sout,baud,[v_UnPlotXY, BallLastX, BallLastY] SEROUT Sout,baud,[v_PlotXY, (BallX-10)/2, (BallY-10)/2] Remember new ball position BallLastX=(BallX-10)/2