Hey, if you've yet to figure out your map() function problem with potentiometers (speed pot), see if this helps...
The first two numbers state the potential lo/hi SCOPE of the speed pot...from 0 to 1,023.
Think of the second number as how many times we're dividing-up the speed pot's sweep...1,024 times starting at zero, just like 1,024 potential points of value we can read.
The third and fourth numbers are the RANGE (point A to point B) we want the SCOPE reMAPped to, but instead of starting at zero and going to 1,023, we start at point A and stop at point B.
e.g., if we used the third value as 200 and the fourth value as 823, we're telling the speed pot we're not interested in it's potential values dropping so low or raising so high, so, we trimmed the lower 200 values off of the bottom-end and trimmed the upper 200 values off of the top-end of the speed pot.
Are ya' with me on this? The upper and lower 200 values on the speed pot were removed; eliminated from potential. No more zero, no more top speed.
This is valuable when dealing with things like dc motors that are temperamental and can't rotate too slowly. Because we've trimmed the bottom 200 values off of the speed pot (values 0 to 199), the speed pot can no longer go to zero; the potentiometer now starts at the remapped value of 200, so the motor cannot go too slow. Likewise, we trimmed 200 values (values 824 to 1,023) off of the top-end of the potentiometer, so we can also control the top speed of the motor in this manner.
So, if you state "1, 24" as the remapping, you can see where your troubles lie. I'm not sure exactly what it is your project curtails, but I hope this may shed some light on the map() function and it's arguments.
best of luck.