Shop OBEX P1 Docs P2 Docs Learn Events
need help with a program — Parallax Forums

need help with a program

stilgarstilgar Posts: 47
edited 2012-04-14 15:29 in Propeller 1
Hello,
I am having trouble with a program from the object exchange by Colin Fox.
The program "led_pwm v1.0 "

When I try to use more than 8 LEDs, the program stops.
Is there a variable I need to change to fix this?

Also my finished project needs to run 32 LEDs, BUT, I only have 20 pins to use for the LEDs. the others are for sensors and sound.
Any points to figure this out?

thanks,
stilgar

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2012-04-13 19:21
    stilgar wrote: »
    When I try to use more than 8 LEDs, the program stops. Is there a variable I need to change to fix this?
    The delay (600) is too short for more than 8 LEDs (with decay it basically traps in a just missed waitcnt). Try bigger values, e.g. 1200 for 16 LEDs.
  • stilgarstilgar Posts: 47
    edited 2012-04-14 09:24
    kuroneko wrote: »
    The delay (600) is too short for more than 8 LEDs (with decay it basically traps in a just missed waitcnt). Try bigger values, e.g. 1200 for 16 LEDs.

    I can not find where the delay at 600 is? the clock settings often gets me confused. Could you direct me to the line in question? and maybe a corrected line?

    thanks,
    stilgar
  • turbosupraturbosupra Posts: 1,088
    edited 2012-04-14 10:22
    I believe he is referring to

    delay long 600

    which represents: variable name/variable data type/variable initial value

    at the bottom of lm_pwm_1.spin in the DAT section
  • stilgarstilgar Posts: 47
    edited 2012-04-14 10:46
    turbosupra wrote: »
    I believe he is referring to

    delay long 600

    which represents: variable name/variable data type/variable initial value

    at the bottom of lm_pwm_1.spin in the DAT section

    Found it, and that was the problem.
    Thank you,
    stilgar
  • turbosupraturbosupra Posts: 1,088
    edited 2012-04-14 13:50
    Don't thank me, thank Kuroneko ; )
  • User NameUser Name Posts: 1,451
    edited 2012-04-14 15:29
    Pity we don't have a Kuroneko to identify the bugs in government programs. :)
Sign In or Register to comment.