davidbuckley.net
home  >  Prowler  >  4 September 2023

Prowler Arduino interface 24 July 2023

Originally Prowler worked from a Sinclair ZX-81, then later an Acorn A3000.
Unfortunately the software is long gone even though the ZX-81 still works.
Following on from making Arduino interfaces for Zero2, Zeaker2, BBBC-Buggy, MM3, and Zeaker I made one for Prowler and so now after thirty years Prowler is again under computer control.

What does the Aduino software enable
The software is built on that written for Bambino then Bamduino. Using a terminal on a PC, commands (see below) can be typed and Prowler controlled. Sixteen Acts can be recorded or loaded into EEPROM and replayed. Any Act can chain to or call any other Act including itself. Eight other ReActs can be recorded or loaded which will be acted upon depending on the state of the bump sensors when the command '$b' is executed.
Prowler knows where it is on an XY grid and can be commanded to go to any position. Navigation is by dead-reckoning so where Prowler thinks it is may not be where it actually is.
Prowler was built very quickly because the magazine - Sinclair Projects - didn't have enough projects. I already had the Tamya motorised tank on the shelf so I used that for Prowler. Unfortunately the tracks have a tendency to come off.

2023-09-04
Added an IR sensor and IRin.ino for Sony IR codes

Arduino software

  • ProwlerArduino.ino
  • Doc_Commands.h
  • Doc_Sections
  • movement.ino
  • sense.ino
  • core.ino
  • IRin.ino
  • show.ino
  • utilities.ino
  • Acts
    ??
    Act1 $bF1,1. - 6 bytes          Explore with bump tests, F1 smallest distance between bump test 
    Act2 F2B2. - 4 bytes
    Act3 B2. - 2 bytes
    Act4 $Gw14. - 5 bytes
    Act5 $b5. - 3 bytes
    Act6 . - 0 bytes
    Act7 . - 0 bytes
    Act8 bc0bt20,bm3,1. - 13 bytes  sets coast off, default turn to 20, default move to 3, then jumps to Act 1
    
    Act01 . - 0 bytes
    Act02 . - 0 bytes
    Act03 . - 0 bytes
    Act04 . - 0 bytes
    Act05 . - 0 bytes
    Act06 . - 0 bytes
    Act07 . - 0 bytes
    Act08 . - 0 bytes
    
    Reactions
    ?!
    f & s indicates bump front or side, code is Left Right bump status, 1=bump  
    ReAct1 f_01  B,B,Mr3{B,Cfr,Cfr,Cfr}Cfl,,. - 27 bytes    {...} is only done if random10 <3
    ReAct2 f_10  B,B,Mr3{B,Cfl,Cfl,Cfl}Cfr,,. - 27 bytes    {...} is only done if random10 <3
    ReAct3 f_11  B,B,Mr5{Cfl,Cfl,}Cfr,Cfr,. - 25 bytes      {...} is only done if random10 <5
    ReAct4 s_01  Cfl,. - 4 bytes
    ReAct5 s_10  Cfr,. - 4 bytes
    ReAct6 s_11  B,B,Mr5{Cfl,}Cfr,. - 17 bytes
    ReAct7 eye   . - 0 bytes
    ReAct8 gnd   . - 0 bytes
    
    Current Behaviour
    ?b
    **behaviour*****
    Prowler 2023-07-24
    0 autoAct
    0 autorun
    5 default move 
    30 default turn
    4 coast time 1/10sec after each move
    c steptype
    800 millisecs for 10cm
    4900 millisecs for 360deg
    1 1=last turn was R
    90.00 map Heading
    0.00 Compass Heading
    
    Saved Behaviour
    ?B
    **EEPROM BEHAVIOUR***** 
    0 autoAct
    3 stepScale10chi
    32 stepScale10clo
    19 rotateScale360hi
    36 rotateScale360lo
    5 defaultMove
    30 defaultTurn
    
    Mind
    ?m
    **MIND********** 
    0.00 moveX steps
    0.00 moveY steps
    90.00 compass N offset from map 0 degrees =X-axis
    90.00 mapHeading degrees
    0.00 AtX cm 0.00in
    0.00 AtY cm 0.00in
    
    Help
    ?h
    COMMANDS
    [Q],[Esc] - stop all
    [.] - stop, quit current operation - recording, playing, input
    ["] - start/end of a comment, processed in GetCcmnd()
    [(] - start of Do, Acts within a Do will be treated as subroutines
    [)] - end of Do
    [0] - use page0 for the next cmnd or Act, Acts [0][1] - [0][8]
          page 1 is the default
    [0] - Acts [!][1] - [!][8]
    [1-8] Play act, or the Act to record, copy, load etc
    [!] - use ReActs page, ReActs [!][1] - [!][8]
       digits should be terminated with [,] or [ ] or other non digit character except [Q] and [.]
       digits may be preceded by a minus sign to reverse direction so F-100, is B100,
    [F]+-digits[,] - Forwards   - if no digits then default move
    [B]+-digits[,] - Backwards  - if no digits then default move
    [R]+-digits[,] - turn Right - if no digits then default turn
    [L]+-digits[,] - turn Left  - if no digits then default turn
    [G}+-digitsX[,]+-digitsY[,] - goto X,Y
    [H] - goto Home
    [D] - Pen down
    [U] - Pen up
    [C][f][l]digits[,] - Curve forwards left   - if no digits then default move
       [f][r]digits[,] - Curve forwards right  - if no digits then default move
       [b][l]digits[,] - Curve backwards left  - if no digits then default move
       [b][r]digits[,] - Curve backwards right - if no digits then default move
    
    Aux
    [a][1] D0 SF on others off - test motor
       [2] D1 SB on others off - test motor
       [3] D2 PF on others off - test motor
       [4] D3 PB on others off - test motor
       [5] D4 on others off
       [6] D5 ledR on others off
       [7] D6 ledL on others off
       [8] D7 Horn on others off[h][0] - horns off
    
    [h][0] - horn off
       [1] - horn on
    [i][0] - indicators off
       [1] - indicatorR on
       [2] - indicatorL on
       [3] - indicatorsRL on
    
    [w][1-9,0] - wait seconds, 0=10
    [n][1-9,0] - nap tenths second, 0=10
    
    [$][b] - sense Bumpers
       [e] - sense Eyefront
       [g] - sense eyedown   'Ground'
    
    Skill
    [m][m] - Move Memory - move same way as last time, same amount
       [o] - Move Other  - move other way from last time, same amount
       [+]+-digitsX[,]+-digitsY[,] - goto X,Y offset from current position
    
    [t][m] - Turn Memory - turn same way as last time, same amount
       [o] - Turn Other  - turn other way from last time, same amount
       [h]digits[,] - Turn to heading
       [C]digits[,] - Turn to Compass heading
       [u] - Turn Unwind
    
    [H] - goto 'home'
    [g][H] - goto 'home'
    [g][0-9] - goto numbered place
    
    Mind
    [M][r][digit][{]commands[}] - if random>digit then do commands and end act
    [@][h] - set current location as new 'home'
       [0-9] - set place (0 - 9) to current location
    [?][m] - print Mind
    [?][p] - print places
    
    Behaviour
    [b][0] - Restore default behaviour
       [S] - Save behaviour as default
       [a][1-8] - Act to autorun on power on
          [0] - no autorun
          [d] - if Playing ends, run autorun Act
       [C]digits[,] - compass offset from map 0 degrees
       [m]digits[,] - default move cm
       [t]digits[,] - default turn deg.
       [c][0]-[9] - coast for 1/10secs after each move
       [r]digits[,] - rotatescale, actual steps for 360 degrees
       [s]digits[,] - stepescale, actual steps for 100mm
       [v] - verbose printing
       [q] - quiet printing, verbose off
    
    System
    [*][r][0 1-8] - record act, 0 use page0
       [l][0 1-8] - load act, 0 use page0
       [c][0 1-8][0 1-8] - copy act to act, 0 use page0
    ["] - start/end of a comment, processed in GetCcmnd()
    
    Print
    [?][?] - prints all acts
       [a] - prints all acts
       [0] - prints acts 0, and changes [?][?] to just print current page
       [1-8] - print Act in current page
       [!] - print ReActs
       [b] - print current behaviour
       [B] - print EEPROM behaviour
       [m] - print Mind
       [d] - dump all acts to PC without descriptions, for reloading
       [p] - places
       [h] - print help
       [e] - print EEPROM use
       [f] - print free RAM
    
    Notes
    [(] - will show its location in EEPRO< when played eg (=263
    [)] - will show its location in EEPRO< when played eg )=285
    If a call to another Act is made from within a Do then the location to return to will be shown, eg (267)
    Acts by default are stored in page 1, 0 changes to page 0 for the next command only.
    Page 0 ia the first 256 bytes of EEPROM, Page 1 is EEPROM bytes 256-511, ReActs is the next 256 bytes, 
    negative numbers allowed for F,B,R,L - so F-20 does B20
    >bad key
    >bad key
    >