curving the map() function
in
Programming Questions
•
6 months ago
Hi-
I am using a ultrasonic sensor (powered by an Arduino) to control the speed of a slideshow array.
In processing, I am mapping the values from the sensor and then using the values in a timer function to run the array....
input_1_mapped = map(input_1, 0, 50, 0, 1000);
The mapping is linear, but I'd like to be able to curve the values so that the change in speed is more dramatic at first but then becomes more gradual as the interactor gets closer to the sensor.
Any ideas how I could manipulate the data to do this?
Thank you.
2