-- convert apex96 value to stringstring = apex96tvstring( apex96tv )string = apex96avstring( apex96av )-- convert fractional seconds to apex96 valueapex96tv = fraction_seconds_to_apex96( fract_seconds )
function print_av(val) local i = 1 local av_str = {"n/a","2.0","2.2","2.5","2.8","3.2","3.5","4.0","4.5","5.0", "5.6","6.3","7.1","8.0","9.0","10.0","11.0","13.0","14.0","16.0"} local av_ref = {176,208,240,272,304,336,368,400,432, 464,496,528,560,592,624,656,688,720,752} while (i <= #av_ref) and (val > av_ref[i]-1) do i=i+1 end return av_str[i]end
Atm I use this method:Code: (lua) [Select]function print_av(val) local i = 1 local av_str = {"n/a","2.0","2.2","2.5","2.8","3.2","3.5","4.0","4.5","5.0", "5.6","6.3","7.1","8.0","9.0","10.0","11.0","13.0","14.0","16.0"} local av_ref = {176,208,240,272,304,336,368,400,432, 464,496,528,560,592,624,656,688,720,752} while (i <= #av_ref) and (val > av_ref[i]-1) do i=i+1 end return av_str[i]end 'val' must be an av96 value. It works similarly for Tv. But the lookup table is bigger.msl
In theory, the shooting.c tables are already setup for each camera so scripts become more camera independent.
The shooting.c tables have only the standard values. And what is with the extended override values?
Another solution would be to create a lua library for such tasks.
Need we really a min/max range? The technical description of each camera give us this information.
Started by d_w_ General Help and Assistance on using CHDK stable releases
Started by bart100IS Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)
Started by trekkie00 General Help and Assistance on using CHDK stable releases
Started by lapser LUA Scripting
Started by reyalp General Discussion and Assistance