Turn Off LCD Scripting - S95 Camera - Script Writing - CHDK Forum  

Turn Off LCD Scripting - S95 Camera

  • 8 Replies
  • 6986 Views
Turn Off LCD Scripting - S95 Camera
« on: 07 / September / 2011, 23:25:39 »
Advertisements
Hi everyone,

I'm very excited to use the S95 on a weeklong backpacking trip and want to use the Ultra Intervalometer script to create great time-lapses.

I tried plugging into the a/v port which does shut off the LCD but it drains the battery faster than turning of the LCD after 10 seconds.  I've also tried several different scripts that should turn of the LCD but have not had any success.

Is it possible to modify this script to turn off LCD in a S95 for the duration of the time-lapse? 

P.S. I hope I'm using an appropriate script and that the interval timing is accurate, feel free to suggest.

Thank you!
Shane





Ultra Intervalometer

rem Author - Keoeeit
rem Upgraded by Mika Tanninen
rem Time accuracy and shutdown for a710is by Viktoras Stanaitis
rem h-accuracy for delay, j-accuracy for interval
h=-1
j=-1755
@title Ultra Intervalometer
@param a Delay 1st Shot (Mins)
@default a 0
@param b Delay 1st Shot (Secs)
@default b 0
@param c Number of Shots (0 inf)
@default c 0
@param d Interval (Minutes)
@default d 0
@param e Interval (Seconds)
@default e 10
@param f Interval (10th Seconds)
@default f 0
n=0
t=(d*600+e*10+f)*100+j
if c<1 then let c=0<br /> if t<100 then let t=100<br /> g=(a*60)+b+h
if g<=0 then goto "interval"<br /> for m=1 to g
print "Intvl Begins:", (g-m)/60; "min", (g-m)%60; "sec"
sleep 930
next m
:interval
n=n+1
if c=0 then print "Shot", n else print "Shot", n, "of", c
shoot
if n=c then shut_down
sleep t
goto "interval"

*

Offline funnel

  • ****
  • 349
Re: Turn Off LCD Scripting - S95 Camera
« Reply #1 on: 08 / September / 2011, 02:56:12 »
You can try adding the "set_backlight 0" at the beginning of the script. However it's possible that the backlight will go back on after the first shoot. The only solution then is to find the function named TurnLCDOff in the firmware and execute it at the beginning of the script. This is a little complicated if you haven't done a chdk port before.

*

Offline fe50

  • ******
  • 3152
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Turn Off LCD Scripting - S95 Camera
« Reply #2 on: 08 / September / 2011, 03:46:23 »
@shane1800
There are several was for power saving, read more in this thread & the links there.
Since the S95 is one of the cameras without an optical viewfinder, most probably the DISP button only toggles the OSD info but doesn't completely disables the LCD.
So option #3 shoul also work on the S95: from the Canon menu, register the "Sleep" ("ZZzzz") function to the shortcut (print) button; holding the shortcut button for ~1.5s now should disable the LCD until you capture the next image (or rotate the camera ;) ).

In a script just emulate pressing the print key, use something like
Code: [Select]
press "print"
sleep 100
release "print"
in the image capturing loop after the shot...

Re: Turn Off LCD Scripting - S95 Camera
« Reply #3 on: 09 / September / 2011, 00:27:32 »
Thanks both of you for your help.

- Updated code below, I think sleep 150 worked better than 100
- Register the "Sleep" ("ZZzzz") function to the shortcut (print)
- Had it ignore the power saving settings when Alt on

Works like a charm!  Goes for 6 hours 20 minutes, HDR every 40 seconds, 16:9 Medium size.

rem Author - Keoeeit
 rem Upgraded by Mika Tanninen
 rem Time accuracy and shutdown for a710is by Viktoras Stanaitis
 rem h-accuracy for delay, j-accuracy for interval
 rem must have print set to sleep, alt to turn of power saving
 h=-1
 j=-1755
 @title Ultra Intervalometer Sleep
 @param a Delay 1st Shot (Mins)
 @default a 0
 @param b Delay 1st Shot (Secs)
 @default b 0
 @param c Number of Shots (0 inf)
 @default c 0
 @param d Interval (Minutes)
 @default d 0
 @param e Interval (Seconds)
 @default e 10
 @param f Interval (10th Seconds)
 @default f 0
 n=0
 t=(d*600+e*10+f)*100+j
 if c<1 then let c=0
 if t<100 then let t=100
 g=(a*60)+b+h
 if g<=0 then goto "interval"
 for m=1 to g
  print "Intvl Begins:", (g-m)/60; "min", (g-m)%60; "sec"
  sleep 930
  next m
 


 :interval
   n=n+1
   if c=0 then print "Shot", n else print "Shot", n, "of", c
   shoot
   
press "print"
sleep 150
release "print"

   
   
   if n=c then shut_down
   sleep t
   

   goto "interval"
   
   


Re: Turn Off LCD Scripting - S95 Camera
« Reply #4 on: 09 / September / 2011, 12:31:44 »
Hi,

With the goal of reducing power consumption even more I was trying to turn of the green LED as it's on all the time.

I found this code and tried inserting it in a few places but resulted in the camera somewhat freezing and not taking pictures.

*((volatile int *) 0xC0220130) = 0x44; // Turn off LED   

Any ideas on where to place it?


Do you have any thoughts on reducing CPU / Clock speed during this scripts wait time.  It's spoken about in this post but not sure how to implement in this time-lapse script.
http://chdk.setepontos.com/index.php?topic=2375.30


Thanks,
Shane

*

Offline srsa_4c

  • ******
  • 4451
Re: Turn Off LCD Scripting - S95 Camera
« Reply #5 on: 09 / September / 2011, 15:48:11 »
Hi,

With the goal of reducing power consumption even more I was trying to turn of the green LED as it's on all the time.
My guess is that most of the LEDs on the camera draw less than 1 mA, so turning the green one off may not save much power.
Quote
I found this code and tried inserting it in a few places but resulted in the camera somewhat freezing and not taking pictures.

*((volatile int *) 0xC0220130) = 0x44; // Turn off LED   
If you put this inside assembly routines, it will cause trouble (disrupts some register values). It's much easier / safer to use it in a script.
Quote
Any ideas on where to place it?
If you use lua scripting, you have access to the poke function (see http://chdk.wikia.com/wiki/LUA/LUA_Reference). But beware, the mmio area (the memory over 0xc0000000) is used to control the camera hardware, so be absolutely sure about the address of the LED.

Re: Turn Off LCD Scripting - S95 Camera
« Reply #6 on: 09 / September / 2011, 17:54:07 »
I found this code and tried inserting it in a few places but resulted in the camera somewhat freezing and not taking pictures.
*((volatile int *) 0xC0220130) = 0x44; // Turn off LED   
Any ideas on where to place it?

Insert it at just before line 192 in trunk\core\main.c like this :

Code: [Select]
        }

        if ((state_shooting_progress == SHOOTING_PROGRESS_PROCESSING) && (!shooting_in_progress())) {
            state_shooting_progress = SHOOTING_PROGRESS_DONE;
            if (raw_need_postprocess) raw_postprocess();
        }

      *((volatile int *) 0xC0220130) = 0x44;        // Turn off LED

        msleep(20);
    }
}

long ftell(FILE *file) {

Alternately you can place it at line 169 like this :

Code: [Select]
        conf.script_startup=0;
        conf_save();
        script_autostart();
    }
#endif

      *((volatile int *) 0xC0220130) = 0x44; // Turn off LED 

while (1) {
        if (raw_data_available) {
            raw_need_postprocess = raw_savefile();
            hook_raw_save_complete();
            raw_data_available = 0;


In the first example,  the LED will be set to "off" every 20 mSecs.   In the second example, it only gets set to "off" once but that should be enough.  It may depend on your specific camera which one works.


« Last Edit: 09 / September / 2011, 17:57:22 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Turn Off LCD Scripting - S95 Camera
« Reply #7 on: 10 / September / 2011, 14:31:49 »
Thank you for taking the time to show me where to place the code.  This is going past my skill set as I don't know how to edit that file.  I wonder if it would save much battery life anyways. 


Shane


Re: Turn Off LCD Scripting - S95 Camera
« Reply #8 on: 11 / September / 2011, 01:32:02 »
Hi,

I have a feeling that this is no possible but when taking 30 second exposures is it possible to have the LCD off when this is happening and when it's busy processing?

I added your code to press the print button after processing is done but couldn't figure out how to do it while the picture is being taken.

Thanks,
Shane



rem Author: barberofcivil http://chdk.wikia.com/wiki/UBASIC/Scripts:_Shutter_Speed_Stack_(AllBest_build)
rem Tested on S2/A570

@title Shutter Speed
@param a EV fraction (1/x EV)
@default a 1
@param b Start Tv (1EV)
@default b 6
@param c Start Tv (1/xEV)
@default c 0
@param d No.Shots
@default d 180
@param e Step Size (y/x EV)
@default e 1
@param f Start Delay (s)
@default f 5
@param g Delay between shots (s)
@default g 30

cls
if f<0 then f=0
if g<0 then g=0
if d<1 then d=1
if a<1 then a=1
if c>=a then c=a-1
if c<0 then c=0
if b<0 then c=-c

if d=1 then print "One shot to be taken" else print d,"shots to be taken"
if d=1 or e=0 then gosub "Single" else gosub "Multiple"

print "Click <set> to proceed"
print "Any button to cancel"

wait_click
is_key z "set"
if z=1 then print "Proceeding..." else gosub "Cancel"

while f>0
  print "Starting in",f,"s..."
  sleep 1000
  f=f-1
wend

print "Starting shots now..."

for i=1 to d
  cls
  print "Shot",i,"of",d
  gosub "ShutterCalc"
  if k>=(2*a) then print "Shutter ~1/"o,"s" else print "Shutter ~"r"."st,"s"
  print "Shutter value:",p
  set_tv96_direct p


  shoot
 
press "print"
sleep 150
release "print"


  sleep 1000*g
next i

end

:ShutterCalc
  k=(1-i)*e-b*a-c
  l=(k/a/4)*4*a
  if k<0 then l=l-4*a
  m=1
  for j = 1 to (l/a/4+3)
    m=m*16
  next j
  m=m/16
  h=(k-l)
  j=(((((((((30*h*h*h)/(4*a))*h)/(4*a))*h)/(4*a))*243)/(4*a))*7)
  j=j-(((((((30*h*h*h)/(4*a))*h)/(4*a))*254)/(4*a))*4)
  j=j+(((((30*h*h*h)/(4*a))*227)/(4*a))*9)
  j=j+(((30*h*h*307)/(4*a))*3)
  j=j+(30*h*850)
  o=(((((((j/(18000)+1)/2)+a)*m)/(128*a)+1))/2)
  p=(k*96)/a
  q=(((51200*a)/(((((j/18000)+1)/2)+a)*m)+1)/2)
  r=q/100
  s=(q-r*100)/10
  t=q-r*100-s*10
return

:Cancel
  print "Shots cancelled"
  end

:Single
  if e=0 and d>1 then print "Tv locked (step=0)"
  i=1
    gosub "ShutterCalc"
    if k>=(2*a) then print "Tv: ~1/"o,"s" else print "Tv: ~"r"."st,"s"
return

:Multiple
  i=1
    gosub "ShutterCalc"
    if k>=(2*a) then print "Tv Start: ~1/"o,"s" else print "Tv Start: ~"r"."st,"s"
  i=d
    gosub "ShutterCalc"
    if k>=(2*a) then print "Tv End:   ~1/"o,"s" else print "Tv End:   ~"r"."st,"s"
return

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal