Potentiometer is not callable

Greetings,

So I’m using Python and running the VEX V5 code online, and after installing the Potentiometer under three wire, the code is bugging out and saying that “potentiometer_a is not callble”, complaining under the robot configuration code.

The issue, is that this is their option to install this using the device menu, so I have no idea why it’s not callable. It’s trying to define it there but seems to have an issue after setting it initially with referring to it.

Any advice on how to fix this?

Sounds like a bug, perhaps post the generated Python code from the top of the file so we can see if there is an issue. Using feedback with project is also an option. However, most staff are out of office at worlds so may be a while before you would get an answer via feedback.

2 Likes

Ok, so after a lot of fiddling around, the potentiometer in the device menu wasn’t actually calling the potentiometer properly at the top. Below is an example of what was being generated

potentiometer_a = potentiometer_a(brain.three_wire_port.a)

This was what it was originally generating. This is what it should have been generating:

potentiometer_a = Potentiometer(brain.three_wire_port.a)

I’ve never seen it generate it like that before. I don’t know if it’s because the student had added V1 to the name, but that still shouldn’t have changed it like that.

Seems to be generating correctly to me - did the student modify the generated robot configuration code manually? If so, deleting and adding the device again should regenerate all of the configuration data.

1 Like

I don’t have experience with this particular issue… but will add a “me too” to the list… learning that naming sensors/motors/etc certain ways does NOT play well with the code. I’d shorten it to “pot_a” and see what happens.

See that was the issue: I deleted it and put it back in, and it didn’t generate the code properly.

The student didn’t directly modify the code, they just modified the name through the device panel.

Please submit feedback from VEXcode. The feedback should have the diagnostic data option enabled so that we can see what VEXcode is doing with the project data. Send the feedback after you have loaded the project with the issue and you have tried to delete and add the potentiometer back to the project. The message in the feedback should also indicate what is happening, so that we can tell it is from you.

So the issue hasn’t been replicated (yet), but I will make sure that if it occurs again to use the feedback.