Advertisement
Guest User

chdk interval

a guest
Apr 12th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. --Interval shooting script
  2. --[[
  3. @title A480 Interval shooting
  4. @param a Interval (Minutes)
  5. @default a 0
  6. @param b Interval (Seconds)
  7. @default b 10
  8. @param c Powerdown on finish
  9. @default c 0
  10. ]]
  11.  
  12. function presets()
  13.      set_iso_mode(0)     -- Auto
  14.      set_prop(218,0)     -- Picture Size (0=maxinum)
  15.      set_prop(6,3)       -- Focus mode to infinity (3)
  16. end
  17.  
  18. function aflock()
  19.      press("shoot_half")
  20.      sleep(2000)
  21.      set_aflock(1)
  22.      release("shoot_half")
  23. end
  24.  
  25. -- Start script
  26.  
  27. pwrdown = c
  28. delay=a*60000+b*1000
  29. if delay<5000 then
  30.      delay=5000
  31. end
  32.  
  33. presets()
  34. print("Presets done")
  35. aflock()
  36. print("Focus locked")
  37. count = 0
  38. print("Taking shots")
  39. tstart=get_tick_count()
  40. repeat
  41.      shoot()
  42.      if count>1 then
  43.          poke(0x6404,1000,4)
  44.      else
  45.          poke(0x6404,4000,4)
  46.          count=count+1
  47.      end
  48.  
  49.      sleep( delay-(get_tick_count()-tstart) )
  50.      tstart=get_tick_count()
  51. until get_free_disk_space()/1024 < 5
  52.  
  53. print("Finishing")
  54. if pwrdown > 0 then
  55.      shut_down()
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement