Trigger on Integer change (compound)

 

It might help other beginners in Aximmetry and save them time. I am building those to learn aximmetry and recreate basic programming workflows.

On of those is trigger an action when an integer internal state has changed.

For example, we have buttons in control boards that correspond to enumerable 0,1,2.. etc and we want to trigger the action ONLY when a button is pressed and is different from the previous button.

Here is the simple compound



We can tweak that if we want to allow the same button to be pressed or/and add debounce time

Here is the compound with debounce time


The Time to Text and log is just for debugging it is working.

Now if you are not interested in the previous state but just debounce and trigger on keypresses this is the compound




The only difference is that we set both NEW_VALUE and CURRENT_VALUE modules to -1 (or any other invalid integer state). So it will just throw away 

   buffos

 
Profile Image
Aximmetry
  -  

Hi,

Thanks for snippets.

To check if a value is changed you can use the Delta module. Changed will be true in the frame when the input just changed.

For text we have a similar node called Text Changed.

Best Regards

 
Profile Image
buffos
  -  

Thank you.

It would be nice to have some kind of documentation of what each module does. 
I know from personal experience that writing documentation is very boring but necessary.

 
Profile Image
Aximmetry
  -  

We are constantly upgrading our documentation and hopefully we will have a full list (with details) from all of our modules in the near future.

Best Regards

 
Profile Image
Alessandro RDK
  -  

Hi! may be you could help me

I need a compound (or maybe a script) that take an Integer as input. Save it somehow... And when I change the value of that input, it return me the previous value.


Can you help me? 

 
Profile Image
buffos
  -  

Here it is. I suggest you study how it works. Its not that different from the others here. It will help you make more complicated ones.

Here is the link (it will be available for a couple of days, until I sync again my data and lose the sharing state in google drive)

https://drive.google.com/file/d/1wfKsNXcn5h7WUeaq-EZOGSQkikHLjxt6/view?usp=sharing