Hello at all
I usually use a macro to remap outputs of different types of sensors. I saw that a "Map function" component was created in FC9.
I want to share this macro and the assembled component, for everyone who still has FC8 like me.. It works with both Int and float variables
Suggestions for improvements are accepted
Thanks
Remap Function
Moderator: Benj
Remap Function
- Attachments
-
- Remap_Component.fcfx
- Macro
- (9.98 KiB) Downloaded 205 times
-
- Remapping.fcpx
- Component
- (1.65 KiB) Downloaded 196 times
-
- Remap_Test.fcfx
- Example
- (10.88 KiB) Downloaded 186 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Remap Function
Hi Bruno.
Thank you for creating the Map component.
My suggestion would be to use a single Long for the calculations as just using ints will cause rollover to occur.
See here.
Credit to our VC member mnf for spotting the issue with the v9 version.
Thank you for creating the Map component.
My suggestion would be to use a single Long for the calculations as just using ints will cause rollover to occur.
See here.
Credit to our VC member mnf for spotting the issue with the v9 version.
Martin
Re: Remap Function
Hi medelec
Thanks for your suggestion, I also had variable overflow problems,
in fact I used a Long variable, even though I wrote Int.
regards
Thanks for your suggestion, I also had variable overflow problems,
in fact I used a Long variable, even though I wrote Int.
regards
- AbhijitR
- Posts: 300
- Joined: Fri Nov 07, 2014 12:48 pm
- Location: Pune, India
- Has thanked: 283 times
- Been thanked: 80 times
Re: Remap Function
Hello! Bruno
First of all many thanks for this post and for the component, to be honest I was struggling with the INT calculations because of the rollover issue but your Floating Variable in the component solved my problem. I do appreciate your thought for making the component for users who are not using V9 and V10 still.
As you mentioned in your post for suggestions, kindly excuse me to speak my mind, but I think your component will get complete by adding the CLAMPING function too in the Parameters, no doubt it is as per your convenience and time availability.
Once again thank you for this nice component.
Regards
Abhi
First of all many thanks for this post and for the component, to be honest I was struggling with the INT calculations because of the rollover issue but your Floating Variable in the component solved my problem. I do appreciate your thought for making the component for users who are not using V9 and V10 still.
As you mentioned in your post for suggestions, kindly excuse me to speak my mind, but I think your component will get complete by adding the CLAMPING function too in the Parameters, no doubt it is as per your convenience and time availability.
Once again thank you for this nice component.
Regards
Abhi