BASIC 4. Upload the BASIC program to the microcontroller

  • The –52 microcontroller uses a pared down version of basic called tiny basic, that allows a limited number of commands (FOR/NEXT, GOSUB and IF/THEN, etc.).

  • The BASIC program uses the microcontroller real-time clock to do the following procedure which is required by the JamCam to take a photograph (it also leaves the camera OFF while not in use to extend battery life):
  • Momentary ON/OFF switch closure (Camera on)
  • Momentary PHOTO switch closure (Photo taken)
  • Wait for photo to be stored
  • Closure of ON/OFF switch for ~7 seconds (Camera off)
  • Resets the clock


  • Here's the program:

    1 bit 145=0 : REM ON/OFF
    2 bit 178=0 : REM PTO
    5 dby 51=0: s=0
    6 n=0 : dby 49=n
    7 input 'enter interval (h)';i
    8 e=0 : dby 50=e
    12 s=dby 51 :e=dby 50 :n=dby 49
    15 print s,e,n
    30 bit 145=0
    35 bit 178=0
    38 if s=i goto 42
    40 goto 12
    42 if dby 49=0 goto 50
    44 goto 42
    50 x=dby 49 : bit 145=1
    55 print 'on'
    60 if dby 49>=x+2 goto 80
    70 goto 60
    80 bit 145=0
    90 y=dby 49
    100 if dby 49>=y+10 goto 120
    110 goto 100
    120 bit 178=1
    125 print 'photo'
    130 if dby 49>=y+13 goto 150
    140 goto 130
    150 bit 178=0
    160 z=dby 49
    170 if dby 49>=z+10 goto 190
    180 goto 170
    190 bit 145=1
    210 if dby 49>z+17 goto 230
    220 goto 210
    230 dby 49=0 :dby 50=0
    240 dby 51=0 :print 'off'
    250 goto 12


  • Or DOWNLOAD ITas a .txt file



  • The BASIC program definitely isn't an example of "tight code". I’d appreciate any improvements!



    PROCEDURE OUTLINE
    1. Overview
    2. Solder four wires onto the JamCam circuit board and disable the flash
    3. Make a circuit board for relays and MOSFETs
    4. Upload a BASIC program to the microcontroller
    5. Set up the batteries and weatherproof enclosures
    6. Download and manipulate your photos
    7. Potential Improvements
    8. Parts list


    Additional comments & suggestions would be appreciated - email me !

    SAMPLE STILL IMAGES AND MOVIES

    Thanks to R. Lewis and J. Sweeney for their electronic and mechanical expertise