A490 Porting - page 10 - DryOS Development - CHDK Forum supplierdeeply

A490 Porting

  • 224 Replies
  • 69320 Views
*

nosebleed

Re: A490 Porting
« Reply #90 on: 12 / December / 2011, 12:52:27 »
Advertisements
Here you are:
Code: [Select]
AUTO - 32768
PROGRAM - 32772
PORTRAIT                 - 16399
NIGHT SNAPSHOT - 16397
KIDS N PETS      - 16402
INDOOR - 16403
LOW LIGHT - 16417
BEACH - 16407
FOLIAGE                 - 16405
SNOW - 16406
SUNSET - 16404
FIREWORKS - 16400
LONG SHUTTER  - 16390
MOVIE - 2609

Also I tried set_capture_mode_canon(16402) but with no luck :(
Code reaches printf("photo #%3d", i)
Code: [Select]
function mode_photo()
  printf("Switching to Photo Mode")
  set_capture_mode_canon(16402)

  -- Flash off
  set_prop(props.FLASH_MODE, 2)

  -- Focus Mode (0,1,3,4,5 = Normal, Macro, Infinity, Manual, Super Macro)
  set_prop(6, 3)
end 

function take_photo(n)
  for i = 1,n do
    printf("photo #%3d", i) <-- Code reaches this point
shoot()
sleep(30000)
  end
end
« Last Edit: 12 / December / 2011, 13:06:10 by nosebleed »

*

Offline reyalp

  • ******
  • 13729
Re: A490 Porting
« Reply #91 on: 12 / December / 2011, 21:46:53 »
Here you are:
Code: [Select]
...
FIREWORKS - 16400
...
Great, added in changeset 1482. I've assumed FIREWORKS is 16408 note 16400 since the latter doesn't exist in the canon list. These can be difficult to distinguish in the CHDK OSD.
Quote
Also I tried set_capture_mode_canon(16402) but with no luck :(
Is your camera in record mode when you are running this ? set_capture_mode* only changes between different recording modes (A, P, KIDS+PETS etc), it does not switch from playback to recording. You can enter record mode with set_record(1)

If you run SCRIPTS/TEST/setmode.lua from playback mode with all the options set to zero, that should verify whether mode switching is working correctly.
Don't forget what the H stands for.

*

nosebleed

Re: A490 Porting
« Reply #92 on: 13 / December / 2011, 12:43:50 »
I don't really understand those things.

Now I do the following. Still it does not take pictures.

Code: [Select]
  printf("Switching to Photo Mode")
  capmode.set(16402)
  sleep(1000)

Re: A490 Porting
« Reply #93 on: 13 / December / 2011, 15:03:48 »
hi,
i load de chdk to a a490, and the flash is no longer working, anyone knows what happened here?
thanks!


*

Offline dvip

  • ****
  • 451
Re: A490 Porting
« Reply #94 on: 14 / December / 2011, 00:33:17 »
@nosebleed

Try:


set_record(1) -- Record mode
sleep(1000)
set_capture_mode_canon(16402) -- KIDS_PETS
sleep(500)
shoot()
set_record(0) -- Play mode


I hope this helps.


*

nosebleed

Re: A490 Porting
« Reply #95 on: 14 / December / 2011, 12:23:55 »
I used my old code from A480. I just used the new set_capture_mode_canon().
Everything works. Takes pics and videos. However I now have another problem.
I have chosen to autostart the script on boot.
Result? Camera shuts down!  ;)

Code: [Select]
--[[
@title Slaros intervalometer
@param v Video length (secs)
@default v 30
@param p Pics between videos
@default p 10
--]]

capmode=require("capmode")
props=require("propcase")

-- convert parameters into readable variable names
param_video_length = v
param_num_pics = p

function printf(...)
  print(string.format(...))
end

function mode_photo()
  printf("Switching to Photo Mode")
 
  -- KIDS N PETS
  set_capture_mode_canon(16402)
  sleep(500)
 
  -- Flash off
  set_prop(props.FLASH_MODE, 2)

  -- Focus Mode (0,1,3,4,5 = Normal, Macro, Infinity, Manual, Super Macro)
  set_prop(6, 3)
end 

function take_photo(n)
  for i = 1,n do
    printf("photo #%4d", i)
shoot()
sleep(30000)
  end
end

function mode_video()
  printf("Switching to Video Mode")
  set_capture_mode_canon(2609)
  sleep(500)
end

function take_video (secs)
  -- start recording
  press("shoot_half")
  press("shoot_full")

  printf("Recording for %d secs", secs)
  sleep(secs*1000)

  -- stop recording
  release("shoot_full")
  press("shoot_full")
  sleep(1000)
  release("shoot_full")

  -- wait for SD. If video size is big it takes more than 1sec to get ready.
  printf("Waiting for SD..")
  repeat sleep(500) until get_movie_status() <= 1
  printf("Ready")
end

--[[ main program ]]

printf("Autonomous Camera Started")

while true do
-- Take photos
mode_photo()
take_photo(param_num_pics)

-- Take video
mode_video()
take_video(param_video_length)
end
« Last Edit: 14 / December / 2011, 12:46:21 by nosebleed »

*

Offline msl

  • *****
  • 1276
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: A490 Porting
« Reply #96 on: 14 / December / 2011, 13:29:53 »
I have chosen to autostart the script on boot.
Result? Camera shuts down!  ;)

Camera starts in play mode. Probably your script must switch from play mode in the record mode.

msl
CHDK-DE:  CHDK-DE links

*

nosebleed

Re: A490 Porting
« Reply #97 on: 14 / December / 2011, 14:17:41 »
A, ha. That did the trick

Code: [Select]

set_record(1)
repeat sleep(50) until get_mode()

But still one little issue.
The first time i boot the camera it shuts down. The 2nd time i boot it works.  ;) ;)


*

nosebleed

Re: A490 Porting
« Reply #98 on: 17 / December / 2011, 04:46:35 »
Ok, I figured out what is going on.
Having the camera autoboot the chdk two things can happen.
If you press the ON button quickly it starts on play mode.
If you press the ON button normaly it starts on record mode.

Re: A490 Porting - remote shutter
« Reply #99 on: 31 / December / 2011, 19:40:57 »
Total newbie here - I totally appreciate the work everyone puts into these hacks!

Just reporting my experience with the usb remote shutter.  On my two A495 cameras, it works as expected, but on the first A490 I tested, I am getting the long lag between triggering the voltage and the shutter releasing.  Others have mentioned the 10 second delay, and I tried the various synchable remote menu options, but nothing seems to fix it.  I'm testing a multiple camera setup, so the synch delay feature (shoot on voltage release) would be great.  Again, works fine on my A495 cameras, if that info. is of any use.

I really hope someone can nail this!  Thanks again.

- Jance

 

Related Topics