Newbie: Error running chdk2tester script - General Discussion and Assistance - CHDK Forum
supplierdeeply

Newbie: Error running chdk2tester script

  • 7 Replies
  • 3284 Views
Newbie: Error running chdk2tester script
« on: 17 / March / 2010, 04:23:36 »
Advertisements
I have just applied Gentled's simplezoomnshoot script to my Canon A640 and tried to test it via the chdk2tester script.  As soon as I plug in the USB gizmo, I get an error saying "Ubasic: 14 bad endif".
Anyone else had a similar problem?

*

Offline zeno

  • *****
  • 891
Re: Newbie: Error running chdk2tester script
« Reply #1 on: 17 / March / 2010, 05:24:23 »
Well, it worked for me when I wrote it! Below is a version without the troublesome "endif". Does that work?
Code: [Select]
@title gentled chdk2 script
rem author Dave Mitchell - dave@zenoshrdlu.com
rem this script does nothing except display the state of the two transmitter joysticks that
rem correspond to the two receiver servo slots connected to the Gentled CHDK2
rem it's designed to let you test that your Gentled CHDK2 is working properly
rem
rem you can modify this script by putting whatever camera actions you like in place of the "print" statements

while 1
   do
      a = get_usb_power
   until a>0
   if a <=4 then gosub "ch1up" else if a <=7 then gosub "ch1mid" else if a <=10 then gosub "ch1down" else if a <=13 then gosub "ch2up" else if a <=16 then gosub "ch2mid" else if a <=19 then gosub "ch2down" else print "error"
wend
end

:ch1up
   print "channel 1 up"
   return

:ch1mid
   print "channel 1 middle"
   return

:ch1down
   print "channel 1 down"
   return

:ch2up
   print "channel 2 up"
   return

:ch2mid
   print "channel 2 middle"
   return

:ch2down
   print "channel 2 down"
   return
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: Newbie: Error running chdk2tester script
« Reply #2 on: 17 / March / 2010, 05:32:00 »
Thanks for that.   :)
I shall try it in the morning when I am less tired  :D
Everything up to then seemed to have gone without a glitch.  Is there anything I could have done which caused the original problem?  I had never even opened any of the script on my PC to change them.  They went direct to my SD.

*

Offline zeno

  • *****
  • 891
Re: Newbie: Error running chdk2tester script
« Reply #3 on: 17 / March / 2010, 07:50:39 »
It's not your problem - it's mine I think. Revisions to the way the "if" statement is implemented in CHDK may have made my scripts fail. I've put revised versions of the scripts on my website at http://www.zenoshrdlu.com/kapstuff/zchdk2.html altering the if-logic so they should work properly on recent CHDK and SDM builds.
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit


Re: Newbie: Error running chdk2tester script
« Reply #4 on: 26 / March / 2010, 06:44:51 »
Before I even get as far as testing the chdk2tester script, I get numerous ***error messages as soon as I plug in my gentled controller attached to my RX.  I know the RX is working okay, so no idea what the problem might be. :(

*

Offline zeno

  • *****
  • 891
Re: Newbie: Error running chdk2tester script
« Reply #5 on: 27 / March / 2010, 04:54:12 »
Geordienz

could you tell me
 - what camera you are using
 - what version of CHDK you are using
 - exactly which gentled you have

That may help me find and answer to your problems

A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: Newbie: Error running chdk2tester script
« Reply #6 on: 27 / March / 2010, 06:04:24 »
Thanks Zeno.

Using A640
CHDK Version is 0.9.9-875 Feb 23 2010,21:31
Gentled is gentLED-CHDK2  Canon  Type  132

*

Offline zeno

  • *****
  • 891
Re: Newbie: Error running chdk2tester script
« Reply #7 on: 27 / March / 2010, 11:40:13 »
Geordienz - the 132 should work fine (mine does!). The "error" message appears if the pulse length generated by the gentled is more than 20ms. Could you put  the simple script below into the CHDK/SCRIPTS folder (under the name TEST.BAS for example) and then run it with the RX plugged in. It will display pulse length information which should vary as you move the appropriate joystick. That may help me figure out what's going wrong.

Dave
Code: [Select]
rem TEST GENTLED 132
while 1
   do
      a = get_usb_power
   until a>0
   print "pulse length=", a
wend
end 
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit


 

Related Topics