I want to script it to take a number (hundreds) of photos, and between each one pulse the DTR line of a COM: port (which will step a turntable).I can make a loop work on the PC in Lua with! for k = 4,13,2 print(k) endI can use the CLI command shoot, and I can use the camera lua command=shoot()But I cannot see how to combine the PC loop with a CLI or camera 'shoot', and also bring in a Lua RS232 library (or even trigger a Windows command line executable).Any suggestions, or pointers to chdkptp scripting examples, please.
!cli:execute("shoot -tv=1/100")
I could not seem to get this bit of Lua code to work within chdkptp, so I used os.execute() to run it separately.
I am using a simple 'shoot' command, and it seems to take about 6 seconds per loop. I think I will investigate using manual focus, as this could speed up the process - it that liekly?
function take_n(n)-- start msg_shell script on the camera con:exec('msg_shell.run(msg_shell)',{libs='msg_shell'})-- press shoot_half for initial focus etc.-- you could send code to set exposure etc before this. con:write_msg("exec press'shoot_half'")-- give the camera some time to focus. In a real version, should have camera side to code to send a message back when ready and use wait_msg sys.sleep(1000) for k = 1,n*2,2 do print(k,n);-- click the shutter con:write_msg("exec click'shoot_full_only'")-- wait 2 sec for shot to finish. again, should use a status msg sys.sleep(2000) os.execute("lua step_400ms.lua") print(k+1); end-- end msg_shell script, also release shoot_half con:write_msg("quit")end
Started by SpumCo Script Writing
Started by toby LUA Scripting
Started by JvdP « 1 2 » General Discussion and Assistance
Started by axman General Help and Assistance on using CHDK stable releases
Started by muhlisgursoy Script Writing