That looks like code from one of my demos. The purpose of the method is to take the value from the ADC and re-scale it to a new range; the second and third values specify the minimum and maximum values of the new range.
The said object is jm_adc0834_ez_demo.spin. And I do believe it is your demo, Jon.
Ok, so if I want to rescale it to a range of midi velocity of 0-127 I would I would replace 750, 2250 with say 27, 127?
Comments
Ok, so if I want to rescale it to a range of midi velocity of 0-127 I would I would replace 750, 2250 with say 27, 127?
If you do in fact want your output scaled from 27 to 127, then the scale() method will do the trick -- and you can do it in one line of Spin: