Pulse width extender

PULSO.xodball (23.1 KB)

I don’t understand what you’re scaling problem is. There is nothing to limit pulse width except that you are using square-wave to generate test pulses. Are you referring to your pulse extension time? Limits for that are easy to change in the above program. Are you referring to your led meter scale? That is also easy to change what value each led comes on for. Since pulse extension time and your led meter are measuring the same thing, there should be no reason to use something like “map” node to scale between them; that would just be working around errors in your code.

excuse me my ignorance
i´m trying to explain that the pulse width modification scope works fine between 0 and 1.
each time i pulse a UP button it add time until it reachs 1.000 but
the 6 leds starts to on at, 0.002, 0.004, 0.006, 0.008, 0.010, 0.014 and 0.016 at this point the 6 leds are on while the pulse width barely starts to add time.
that is to say that the 6 leds they light up at 1/6 of the total scope

Maybe I see in that way because I put the square-wave very slow.
If I set the real speed then it must work.
thanks and excuse my folly

You can change your led meter to handle 0-1 values by changing the values in the greater compares.

Something is not right, I did not consider it.
When using OR, the initial pulse time is being added, therefore the addition of time with delay will not have the expected effect.

To achieve the result you need, multiply the T * Duty and add it to the result of the counter, that value send it to T of delay node.
So add time to the initial pulse time.

I also think I understand when it says 0-1, and if … it is False-True, only the time will vary, now if you want to vary amplitude it is already another story.

TimelyFewCatfish-size_restricted1

That’s why in my original code, I started the delay timer with pulse-on-false. That causes the delay to be added to initial pulse. Your example starts the timer with the start of the pulse & requires knowing how long the pulse is before you start the timer. That works with square-wave generated pulse, but not for any random input.

Of course I made the patch of zero and now I missed that :sweat_smile:

ok thank for your response, now i can practice with the arduino nano board i receive yesterday.
could you take up the subject and continue helping me please

I don´t want to vary the amplitude

question: my project is going to be only between 0 and 30 ms so
maybe i don´t need to until 1 (1000) ?

You need to adjust the meter for whatever values you are expecting. Note that just because you are “expecting” values between 0 & 30ms doesn’t mean those are the only values you will actually get unless your code enforces it.

i´ll receive random pulses ( between) 0 and 15 ms, then i want to add “time”

hi. there, don´t forget me please. thanks

I don’t know what you are still asking for. Several solutions have been provided above. Have you tried any of them? What did/didn’t work? What additional questions do you have? Do you have sample code you are trying to get working?

thanks i´ll practice

Retriggerable monostable multivibrator IC chip io maybe gsune

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.