Timing a high input pulse

Hi Brad

I will test it and let you know how it goes.

Thanks for all of your efforts, Dan

Hi Brad

The node works perfectly! I didn’t have any trouble loading in to my library. I was a little confused for a moment when I seen the 3 or more parts to it.

When you put it all together could you make two different nodes, one for the tilt and a second one called pulse in? The pulse in, just one port, will come in handy for measuring

external events.

I am looking forward to trying the completed node.

Thanks again, Dan

Sure.
The first block is for the connection to your HW.
The second block does the work getting the particular sensor value, it is set to continuous by default but if you connect a pulse to the INT pin it will only retrieve a value when pulsed and send a pulse on the OK pin when completed.
the last two are only for debugging and are not necessary.

It will all make a lot more sense when i put notes on all the pins :smile:

I will do the other sensors now

What would the pulse in block be for?

There you go Ver 0.0.6 is up.
All the sensors and notes.
Should make things a bit clearer.
Only use one device block per Chip but you can have as many of the others as you want. (and can be passed to other/sub patches if you need)

Hi Brad
Pulsein can be used for extending a single button for several functions:
A but could have a delay to it to prevent false presses, some times a button is accidentally pressed, in this case if the button isn’t pressed for more than 1 second it isn’t acknowledged. Or if the button is pressed for .1 to 1 second one process would be started, if the button is pressed for 1.1 to 2 seconds some other process can be started etc.
A magnetic switch can be scanned to see how fast something is occurring.
“PULSIN Pin, State, Variable” as it is in Pbasic by Parallax, I ve used it many times. Used as a fast stop watch.

Hi Bradzilla84

I have tried the MX2125 nodes and have found that ACCEL, the TILT work pretty good (there is some offset issues), but the node marked MX2125 does not have any

association to the graphical output pin. Is the mx2125 node suppose to put out the raw data presented at the inputs?

The raw data maybe the best data to work with, one could use the map node to help with handling the data offset.

Dan

Hi Dan
This is just a Wrapper for the Lib done by Aaron Magill

The MX2125-Device block outputs a link to the Lib after it has been setup so all the nodes can share the same single library.

You can change the formula that the block calculates with.
Check out the GitHub repository for instructions:

“Milli G’s seems more intuitive to me, so calculations based upon [2] for acceleration are the default. Comment out #define USE_MILLI_G in Mx2125.h if you wish to use Parallax’s formula with a nominal division of 1/1250 G instead.”

These files will be located in your “C:\Users\UserName\xod_ardulib_\Mx2125” Folder

As for your “Multi Function Button” idea i like it i will take a look at it (i will need it in a project i have in mind):smile:
If i understand you correctly you are looking for single block with multiple pulse outputs based on number of presses in a given time frame (I will add a hold set as well if the button is held for X seconds).
I am thinking 2 blocks (for ease of use) .

Hi Bradzilla

I think you are on the right track. As long as the node counts how long the port is high and stops counting when the port goes low then that will work great for me.

You should set the node up so that it will count high pulses when set to true, and count low pulses if set to false.

You are doing a great job!

Thanks, Dan