Zero2 Microrobot

Zero2 software

Zero2 QL program

Current program is ver 2.8
Zero2QLreadme.txt - Readme file for zero2.bas, also reproduced below
zero2_bas - QL control program
index of Procedures and Functions in zero2.bas
'Zmem' - long term memory file for zero2.bas
'Zmem_names' - routine names in long term memory 'Zmem'
#Help screens enter help to get screens
#Initialisation screens on program startup
#Operation screens, controlling Zero2
#Editing screen, editing the program
cartridge cloning program Clone.bas as text file
# Running Zero2 from a PC with QPCII
Thoughts on commands (454KB) #Initial Thoughts
#Further Thoughts
Dimensions of screen-robot in zero2_bas
Robotics on the QL - Quanta article 2006 Robotics on the QL 1
Robotics on the QL 2
Robotics on the QL 3
Folder view of 'SoftwareQL' for miscellaneous files prefixed '+'

what is the significance of the red border to the map? - none, it looks pretty

Useful cmnds easily added
	RF - RightForward	move left wheel only, turn 0.5deg. per step
	RB - RightBackward	move left wheel only, turn 0.5deg. per step
	LF - LeftForward	move right wheel only, turn 0.5deg. per step
	LB - LeftBackward	move right wheel only, turn 0.5deg. per step

Zero2QL readme

Before use it is advisable to make a back-up copy of the cartridge.
Reset the QL
Press F2
Put the master cartridge in mdv2_
Put a blank cartridge in mdv1_
Enter LRUN mdv2_clone
This will format the cartridge in mdv1_ and copy over all the files from the master cartridge.

To Use

Reset the QL
Put the cartridge in mdv1_
Press F2

The boot program will load automatically and will then load and run the main program Robot. Robot will then look in files Zmem and Zmem_names to see if any routines were saved from the last session, and if so it will load them into its memory. It then prompts for a speed-factor and gives an option to set the pen position to 'up'. If this option is not taken the it presumes the pen is already in the 'up' position.

The speed-factor and pen position initialisation can be done at any time by entering zinit which also initialises the serial channel, or just the pen positior can be altered by entering peninit. Entering help will display a series of 'Help' screens listing all the commands available to the user that the program understands. However since the user is operating directly in SuperBasic (see 'Program Operation' next section) any legal SuperBasic command will be executed, even 'list'.

At the end of a sesssion enter quit and this will update and close the files Zmem and Zmem-names. Failure to use quit will almost certainly leave Zmem and Zmem-names in a poor state as the QL file buffers are only flushed when the files are closed. Should it happen the program will probably error in the next session when any long-term memory routine is called (by mexec).
Entering LRUN mdv1_Initmem will restore Zmem and Zmem-names to their empty state.

Cartridge Files

   Boot		loading program for Robot			Basic
   Robot	robot control program				Basic
   Zmem		holds all long-term memory routines		Data
   Zmem-names 	holds routine names and lenghts			Data
   Initmem	initialises Zmem and Zmem-names to empty	Basic
   Clone	cartridge back-up program			Basic
Program Operation
Most of the program consists of SuperBasic procedures which are invoked directly by the user at the keyboard and since the early QLs (pre JS) had no error trapping facilities available from SuperBasic the program uses two ways to protect itself.

For those procedures which are learnable robot commands and are also User invoked with a parameter eg. 'FD n' etc. failure to append any parameter will lead to a program error. This can be overcome by then entering oops which prompts for the missing data and executes a SuperBasic RETRY.

Other procedures are invoked by name only and they then request any data they need.

Running Zero2 from a PC with QPCII

If the Zero2 program-file is Zero2_bas then it can be LRUN from Superbasic with a DO file as follows
ie 'DO dodosZ2'
using the WIN file
eg dodosZ2='LRUN win1_zero2_zeroz.bas' then the program will load and run,
The data files Zmem and Zmem-names can be anywhere, edit the program following line 200 so directory$ holds the location; eg directory$='win1_zero2_'
using Windows folders
I find it much easier to edit using a Windows editor, eg 'Programmers File Editor' and keep the files under Windows.
if dodosZ2='LRUN DOS6_QL_Z2_Zero2_bas' then the program will load and run,
(presumes H:\QL\Z2\Zero2_bas)
the program can be edited in QPCII and entering 'save' will save the program back as H:\QL\Z2\Zero2_bas
The data files Zmem and Zmem-names can be anywhere, edit the program following line 200 so directory$ holds the location; eg directory$='dos6_QL_Z2_' if they are in the same folder as Zero2_bas
The files Zero2_bas, Zmem and Zmem-names can be dragged into a browser to view or any editor which can handle the Unix style line ends.
LRUNing a file with PC-DOS style CRLF line ends results in 'syntax error'
Turtle graphics aspect ratio
At 1280 x 1024 screen size under XP on a 19" LCD monitor, if the QL screen measures 150 x 105 mm then squares are square.
Have to stretch the Windows window vertically to get 105.
				150*105 =>1.43:1
Windows screen resolution	QPCII QL screen size in mm under XP on a 19" LCD monitor
	1280*1024		150*75 =>2:1
	1280*960		150*80 =>1.875:1
	1280*768		145*100 =>1.45:1
		QL screen pixels are square, but all text in Windows and QPCII is poor!
	800*600			241*128 =>1.13:1
Best results are at 1280*1024 and manually stretch the QPCII window to adjust the QL screen.

Help Screens

enter help to display screens

Program initialisation

Program operation

Edit program