# Pulse width extender

**URL:** <https://forum.xod.io/t/pulse-width-extender/3437>\
**Category:** XOD Programming Questions\
**Created:** [February 6, 2020, 3:48am UTC](https://forum.xod.io/t/pulse-width-extender/3437 "2020-02-06T03:48:33Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![gsune](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gsune/32/1966_2.png) [@gsune](https://forum.xod.io/u/gsune)\
**Post date:** [February 7, 2020, 9:38pm UTC](https://forum.xod.io/t/pulse-width-extender/3437/21 "2020-02-07T21:38:09Z")

</div>

thanks to all i think the program works  
now i want to insert 6 leds to “see” the level i add or in others words when i add until the top the 6 leds stays on, when i low the pulse width none stay on

---

<div class="post-metadata">

**Author:** ![gsune](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gsune/32/1966_2.png) [@gsune](https://forum.xod.io/u/gsune)\
**Post date:** [February 7, 2020, 9:39pm UTC](https://forum.xod.io/t/pulse-width-extender/3437/22 "2020-02-07T21:39:48Z")

</div>

![5](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/6/664dc63888e737dad67157b5edba7cc51bc5a849.png)

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [February 7, 2020, 9:48pm UTC](https://forum.xod.io/t/pulse-width-extender/3437/23 "2020-02-07T21:48:53Z")

</div>

Can place greater nodes at the count output and compare if they are greater than a value, for example in\> 0.006, in \> 0.010

and the output to each led

![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/2/25a037adc300f45b170d39e010fe303cfe117858.png)

---

<div class="post-metadata">

**Author:** ![gsune](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gsune/32/1966_2.png) [@gsune](https://forum.xod.io/u/gsune)\
**Post date:** [February 7, 2020, 10:04pm UTC](https://forum.xod.io/t/pulse-width-extender/3437/24 "2020-02-07T22:04:26Z")

</div>

![6](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/e/eabc726d0e5ac12912472ad9786a8a2e10e690b9.png)

---

<div class="post-metadata">

**Author:** ![gsune](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gsune/32/1966_2.png) [@gsune](https://forum.xod.io/u/gsune)\
**Post date:** [February 7, 2020, 10:15pm UTC](https://forum.xod.io/t/pulse-width-extender/3437/25 "2020-02-07T22:15:47Z")

</div>

![7](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/7/792ff08421dcd4e6772251ee66ceac2cb9e4e66c.png)

where do i have to put the “0.006, in \> 0.010” ???  
thanks

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [February 7, 2020, 11:34pm UTC](https://forum.xod.io/t/pulse-width-extender/3437/26 "2020-02-07T23:34:39Z")

</div>

well it’s something very simple, just put 0.006 there … or the value you want. In\> 0.006 was like saying input in1 greater than in2

you also have all the LEDs in D0 you have to change them

---

<div class="post-metadata">

**Author:** ![gsune](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gsune/32/1966_2.png) [@gsune](https://forum.xod.io/u/gsune)\
**Post date:** [February 8, 2020, 3:04am UTC](https://forum.xod.io/t/pulse-width-extender/3437/27 "2020-02-08T03:04:29Z")

</div>

![9](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/6/67bd47b6205909c3c5b1cc30e07b16681afb5e9e.png)  
a question:  
i put 2 watch to see the original pulse vs the extended, when i push severals time in the down button in “pulse” button it seems to reduce but it never be equal.  
it supposedly be flashing at the same time but it don´t

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [February 8, 2020, 3:14am UTC](https://forum.xod.io/t/pulse-width-extender/3437/28 "2020-02-08T03:14:57Z")

</div>

Have you tried adding a watch node to count? You don’t have anything limiting how high or low count goes. I don’t know what happens to delay if you feed it a negative time. You could add hate nodes between buttons and count to disable buttons when count is at its extremely range.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [February 8, 2020, 3:15am UTC](https://forum.xod.io/t/pulse-width-extender/3437/29 "2020-02-08T03:15:18Z")

</div>

first that goes up and down 0.002, and the value is 0.015 so that will be 0.016 for that change.

Second, it is simulating … therefore the refreshment of the watch will depend on the resources of the pc to simulate.

Third, the addition of “or” by **gweimer** has a reason and is so that the initial pulse is not delayed, maybe in your project you don’t need it, but I’m not sure.

---

<div class="post-metadata">

**Author:** ![gsune](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gsune/32/1966_2.png) [@gsune](https://forum.xod.io/u/gsune)\
**Post date:** [February 8, 2020, 4:03am UTC](https://forum.xod.io/t/pulse-width-extender/3437/30 "2020-02-08T04:03:27Z")

</div>

ok now i understand how to play with the up and down buttons BUT.  
i´m doing something wrong with the math.  
the scale of the count node is between 0 and 1 divided 0.002 each time i press a button.  
the leds are working great between 0 and 0.015  
but the pulse width add works between 0 and 1 ( 0 to 1.000)

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [February 8, 2020, 4:07am UTC](https://forum.xod.io/t/pulse-width-extender/3437/31 "2020-02-08T04:07:39Z")

</div>

no, you add or subtract 0.002, you can go up to 100, 2000 or more. But as gweimer says it can be negative by not stopping at 0 and going to -2, -30, etc.

![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/d/d6df8b021b7a233f29ae194df89e4b7e9a2b1127.png)

add the multiplier per 1000 just to show the results, it is not necessary for operation

---

<div class="post-metadata">

**Author:** ![gsune](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gsune/32/1966_2.png) [@gsune](https://forum.xod.io/u/gsune)\
**Post date:** [February 8, 2020, 4:44am UTC](https://forum.xod.io/t/pulse-width-extender/3437/32 "2020-02-08T04:44:14Z")

</div>

there are severals hate nodes, which one do i have to choose?

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [February 8, 2020, 4:48am UTC](https://forum.xod.io/t/pulse-width-extender/3437/33 "2020-02-08T04:48:28Z")

</div>

other configuration, use library [e/comparison](https://xod.io/libs/e/comparison/)

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/1/1be45727bfd8bd42ab8de1316a9dc4a0764c9b15.png)

---

<div class="post-metadata">

**Author:** ![gsune](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gsune/32/1966_2.png) [@gsune](https://forum.xod.io/u/gsune)\
**Post date:** [February 8, 2020, 4:51am UTC](https://forum.xod.io/t/pulse-width-extender/3437/34 "2020-02-08T04:51:54Z")

</div>

i mean for the limiter

[gweimer](https://forum.xod.io/u/gweimer)

[2h](https://forum.xod.io/t/pulse-width-extender/3437/28)

Have you tried adding a watch node to count? You don’t have anything limiting how high or low count goes. I don’t know what happens to delay if you feed it a negative time. You could add hate nodes between buttons and count to disable buttons when count is at its extremely range.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [February 8, 2020, 5:03am UTC](https://forum.xod.io/t/pulse-width-extender/3437/35 "2020-02-08T05:03:47Z")

</div>

Well, I just gave you two examples of limiters from 0 to 0.030

---

<div class="post-metadata">

**Author:** ![gsune](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gsune/32/1966_2.png) [@gsune](https://forum.xod.io/u/gsune)\
**Post date:** [February 8, 2020, 2:49pm UTC](https://forum.xod.io/t/pulse-width-extender/3437/36 "2020-02-08T14:49:59Z")

</div>

thanks you for your valuable help  
can you please tell me how to search the triangle in the libraries ?

 ![10](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/2/299e0e98e40a483cd5d1415108b3338d12248d34.png)

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [February 8, 2020, 2:57pm UTC](https://forum.xod.io/t/pulse-width-extender/3437/37 "2020-02-08T14:57:23Z")

</div>

is the line of defer that goes to the comparators, press B key and becomes buses

[https://xod.io/docs/](https://xod.io/docs/)  
[https://xod.io/docs/guide/](https://xod.io/docs/guide/)  
[https://xod.io/docs/guide/buses/](https://xod.io/docs/guide/buses/)

---

<div class="post-metadata">

**Author:** ![gsune](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gsune/32/1966_2.png) [@gsune](https://forum.xod.io/u/gsune)\
**Post date:** [February 8, 2020, 3:22pm UTC](https://forum.xod.io/t/pulse-width-extender/3437/38 "2020-02-08T15:22:46Z")

</div>

![11](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/6/67741457d805617cc679cc960a1b27bb7da6c563.png)

Not working, i choose the up button, then in left menu i press “pulse” button and nothing happens, the count watch keeps 0.00  
this forums didnt let me post any more becase it´s my “firsts day”

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [February 8, 2020, 3:36pm UTC](https://forum.xod.io/t/pulse-width-extender/3437/39 "2020-02-08T15:36:50Z")

</div>

> [@cesars](#):
>
> add the multiplier per 1000 just to show the results, it is not necessary for operation

without a multiplier you will not see the change, also if you want to use buttons, tweak-pulse only serve to simulate, they must combine with “any” node

---

<div class="post-metadata">

**Author:** ![gsune](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gsune/32/1966_2.png) [@gsune](https://forum.xod.io/u/gsune)\
**Post date:** [February 8, 2020, 9:39pm UTC](https://forum.xod.io/t/pulse-width-extender/3437/40 "2020-02-08T21:39:09Z")

</div>

ok working great but still have a difference in scale.  
leds works between 0 and 0.015 but  
pulse width works between 0 and 1

[Previous page](https://forum.xod.io/t/pulse-width-extender/3437.md?page=1)

[Next page](https://forum.xod.io/t/pulse-width-extender/3437.md?page=3)
