davidbuckley.net
home  >  DoubleVision 22 August 2023

Double Vision Arduino Upgrade
18 August 2023

The Arduino Uno takes the place of the ZX-81 and allows Double Vision to be used with a Terminal program on a PC.

  • the foveal aim can be moved Up, Down and Left and Right.
  • A scene can be scanned and the Left and Right images saved to Uno RAM.
  • The images can be be scaled to 16 brightness levels and displayed as Hex values 0 to F.
  • The scaled image can be saved to back to RAM.
  • The images can be thresholded to remove dark or bright areas.
  • A section of the image can be specified.
  • The distance to an object can be calculated.

     White Block on Black Background 9" away, eye spacing 2.6".
     Taking the column with the highest brightness,
     Left image of block is offset 4 pixels from Right image, at 4deg/pixel =16deg.
     With 2.6" eye spacing 16 deg =9.3" distance. ->Satisfactory, most satisfactory[1]
                    Left                                  Right
      ------------------------------------  ------------------------------------
      | 22110000000000000000000000000000 |  | 22220000000000000000000000000000 |4 degrees pixel spacing
      | 11000000000000000011221100000000 |  | 33220000001111110000000000000000 |
      | 00000000001122110077AA3300000000 |  | 000000001199BB771111221100000000 |The upper left corner is 
      | 00000000002233222288AA3300000000 |  | 0000000022DDFFDD1111110000000000 |light from a window
      | 00000000002233221177993300000000 |  | 0000000022DDFFBB2211110000000000 |
      | 00000000002233221177882200000000 |  | 0000000011BBEEAA1111110000000000 |X=0,15  Y=0,15
      | 00000000002222111155772200000000 |  | 000000001188CC881111110000000000 |threshold=0 light
      | 00000000001122111155661100000000 |  | 000000001188BB991111110000000000 |Range=9 inches
      | 00000000001122110044551100000000 |  | 000000001177AA771100000000000000 |
      | 00000000001111111133441100000000 |  | 00000000116699770011000000000000 |
      | 00000000000011000011110000000000 |  | 00000000002244220000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000011000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      ------------------------------------  ------------------------------------
      ------------------------------------  ------------------------------------
      | 2211                             |  | 2222                             |X=0,15  Y=0,15
      | 11                112211         |  | 3322      111111                 |threshold=1 light
      |           112211  77AA33         |  |         1199BB7711112211         |
      |           2233222288AA33         |  |         22DDFFDD111111           |
      |           22332211779933         |  |         22DDFFBB221111           |
      |           22332211778822         |  |         11BBEEAA111111           |
      |           22221111557722         |  |         1188CC88111111           |
      |           11221111556611         |  |         1188BB99111111           |
      |           112211  445511         |  |         1177AA7711               |
      |           11111111334411         |  |         11669977  11             |
      |             11    1111           |  |           224422                 |
      |                                  |  |             11                   |
      |                                  |  |                                  |
      |                                  |  |                                  |
      |                                  |  |                                  |
      |                                  |  |                                  |
      ------------------------------------  ------------------------------------
      ------------------------------------  ------------------------------------
      | 22                               |  | 2222                             |X=0,15  Y=0,15  
      |                     22           |  | 3322                             |threshold=2 light
      |             22    77AA33         |  |           99BB77    22           |
      |           2233222288AA33         |  |         22DDFFDD                 |
      |           223322  779933         |  |         22DDFFBB22               |
      |           223322  778822         |  |           BBEEAA                 |
      |           2222    557722         |  |           88CC88                 |
      |             22    5566           |  |           88BB99                 |
      |             22    4455           |  |           77AA77                 |
      |                   3344           |  |           669977                 |
      |                                  |  |           224422                 |
      |                                  |  |                                  |
      |                                  |  |                                  |
      |                                  |  |                                  |
      |                                  |  |                                  |
      |                                  |  |                                  |
      ------------------------------------  ------------------------------------
      ------------------------------------  ------------------------------------
      |                                  |  |                                  |X=0,15  Y=0,15
      |                                  |  | 33                               |threshold=3 light
      |                   77AA33         |  |           99BB77                 |
      |             33    88AA33         |  |           DDFFDD                 |
      |             33    779933         |  |           DDFFBB                 |
      |             33    7788           |  |           BBEEAA                 |
      |                   5577           |  |           88CC88                 |
      |                   5566           |  |           88BB99                 |
      |                   4455           |  |           77AA77                 |
      |                   3344           |  |           669977                 |
      |                                  |  |             44                   |
      |                                  |  |                                  |
      |                                  |  |                                  |
      |                                  |  |                                  |
      |                                  |  |                                  |
      |                                  |  |                                  |
      ------------------------------------  ------------------------------------    
      ------------------------------------  ------------------------------------
      |   110000000000000000000000000000 |  |     0000000000000000000000000000 |X=0,15  Y=0,15  
      | 11000000000000000011  1100000000 |  |     0000001111110000000000000000 |threshold=2 dark
      | 000000000011  1100      00000000 |  | 0000000011      1111  1100000000 |
      | 0000000000              00000000 |  | 00000000        1111110000000000 |
      | 0000000000      11      00000000 |  | 00000000          11110000000000 |
      | 0000000000      11      00000000 |  | 0000000011      1111110000000000 |
      | 0000000000    1111      00000000 |  | 0000000011      1111110000000000 |
      | 000000000011  1111    1100000000 |  | 0000000011      1111110000000000 |
      | 000000000011  1100    1100000000 |  | 0000000011      1100000000000000 |
      | 000000000011111111    1100000000 |  | 0000000011      0011000000000000 |
      | 00000000000011000011110000000000 |  | 0000000000      0000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000011000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      ------------------------------------  ------------------------------------
      ------------------------------------  ------------------------------------
      | 22110000000000000000000000000000 |  | 22220000000000000000000000000000 |X=0,15  Y=0,15  
      | 11000000000000000011221100000000 |  |   220000001111110000000000000000 |threshold=3 dark
      | 000000000011221100      00000000 |  | 0000000011      1111221100000000 |
      | 000000000022  2222      00000000 |  | 0000000022      1111110000000000 |
      | 000000000022  2211      00000000 |  | 0000000022      2211110000000000 |
      | 000000000022  2211    2200000000 |  | 0000000011      1111110000000000 |
      | 000000000022221111    2200000000 |  | 0000000011      1111110000000000 |
      | 000000000011221111    1100000000 |  | 0000000011      1111110000000000 |
      | 000000000011221100    1100000000 |  | 0000000011      1100000000000000 |
      | 000000000011111111    1100000000 |  | 0000000011      0011000000000000 |
      | 00000000000011000011110000000000 |  | 000000000022  220000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000011000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      ------------------------------------  ------------------------------------
      ------------------------------------  ------------------------------------
      | 22110000000000000000000000000000 |  | 22220000000000000000000000000000 |X=0,15  Y=0,15  
      | 11000000000000000011221100000000 |  | 33220000001111110000000000000000 |threshold=4 dark
      | 000000000011221100    3300000000 |  | 0000000011      1111221100000000 |
      | 000000000022332222    3300000000 |  | 0000000022      1111110000000000 |
      | 000000000022332211    3300000000 |  | 0000000022      2211110000000000 |
      | 000000000022332211    2200000000 |  | 0000000011      1111110000000000 |
      | 000000000022221111    2200000000 |  | 0000000011      1111110000000000 |
      | 000000000011221111    1100000000 |  | 0000000011      1111110000000000 |
      | 000000000011221100    1100000000 |  | 0000000011      1100000000000000 |
      | 00000000001111111133  1100000000 |  | 0000000011      0011000000000000 |
      | 00000000000011000011110000000000 |  | 000000000022  220000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000011000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      | 00000000000000000000000000000000 |  | 00000000000000000000000000000000 |
      ------------------------------------  ------------------------------------
      [1] Dr Beaker
    
    Arduino program
  • DoubleVision.ino
  • Doc_Arduino_PortPins.h
  • Doc_Commands.h
  • Doc_Sections.h
  • sense.ino
  • show.ino
  • utilities.ino
  • 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
    [1-8] - Play act, or the Act to record, copy, load etc
    [G]<0-X-15>[,]<0-Y-15>[,] - goto X,Y
    [H] - goto 'home'
    [S] - Scan
    [P] - Print images
    [T] - scale brightness and update memory
    [E] - save Left image to EEPROM, for testing only
    [R] - calculate range to obstacle
    
    [u] - move fovea aim Up    2 degrees
    [d] - move fovea aim Down  2 degrees
    [r] - move fovea aim Right 2 degrees
    [l] - move fovea aim left  2 degrees
    
    [w][1-9,0] - wait seconds, 0=10
    [n][1-9,0] - nap tenths second, 0=10
       
    Behaviour
    ---------
    [b][0] - Restore default behaviour
       [S] - Save behaviour as default
       [r][0-9] - pixel resolution degrees (7)
       [b]<1-64>[,] - set to brightness of scene
          [a] - auto set brightness of scene  
       [t][l] - print brighter than threshold   
          [d] - print darker than threshold   
          <0-16>[,] - threshold for printing values
       [p]<0-64>[,] - number of servo pulses between pixels when scanning    
       [y][+]<0-15>[,] - maximum row in scan
          [-]<0-15>[,] - minimum row in scan
       [x][+]<0-15>[,] - maximum column in scan
          [-]<0-15>[,] - minimum column in scan
       [a][1-8] - Act to autorun on power on
          [0] - no autorun
          [d] - if Playing ends, run autorun Act
       [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
       [b] - print behaviour
       [B] - print EEPROMbehaviour
       [d] - dump all acts to PC without descriptions, for reloading
       [h] - print help
       [E] - print EEPROM use
       [f] - print free RAM
       [$] - print sensor values