fun with potentiometers

Hello again everybody…
I’m programming my arm to travel to 4 preset heights using a potentiometer (30 inch, 20 inch, 11.5 inch, floor) when I press the four buttons on channel 7 of my joystick. I opened a window in EASY C that showed me the values I was recieving from all of my sensors. The potentiometer on the arm was giving me a range of what looked like about 0 to 70 or so. But the potentiometer returns values of 0 to 1024, correct?

The question is this:

Which values should I use to program the preset heights?

That is correct, it goes from 0 to 1024. Not entirely sure why it would do that. I’ll think about it. As for what heights, it all really depends how you have the potentiometer attached. Then you will probably just need to experiment. If you could show a picture of how it is attached that would be helpful.

Are you sure that the battery is connected and the cortex is on? If the cortex is powered by just the USB port, then you can get ranges like you’re describing.

a scenario which this might occur is the potentiometer is not mounted to allow full range of motion. Have you tested a potentiometer disconnected from the robot to see what values are returned? When the potentiometer reads 0 can the arm travel past the point you get a 0 reading? if so you probably need to adjust the potentiometer position. rotate them so the radings cover the intended range of motion.

I also use potentiometers to select autonomous modes, and they were also giving me those values… The cortex may not have been turned on…

It wasn’t. I believe this to be the problem. I will test the program again.

Yes, that was the problem. Mental note: turn things on before testing them.

Yeah, it’s a common problem. You see the LEDs light up and everything, so it’s easy to miss.