Map() with defined Boundaries...

Hey guys
Im looking for a function like map() where i can define the input barriers of a potentiometer
somthing like
if value between 0 and 30-> 1
if value between 30 and 35 ->2
if value between 35 and 50-> 3
....

anyone an idea?

int myMap (unsigned int input)
{ 
  if (input < 31) return 1;
  // and so on
}

Cool thank you!!!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.