Pulse length Multiplier Demo using a leaky bucket

move the mouse over the button to simulate the input going high.

This uses a timer tick and adds and subtracts to counters. Their units are now time related.

Also poll input looking for changes to reset the counters

This integrates up dTinput while the input is pressed, and slowly leaks, this keeping the ouput high while dTinput > 0.

When the mouse is over the input button, dTinput is incremented per timer tick by 5 counts. Each timer tick, it is decremented by 1 and while it is greater than 0, the output is high.

This is an example of a leaky bucket

INPUT:

OUTPUT:


output

Uses JavaScript. Do view source to find out how it works. Doug Rice, Copyright 2010