Hello, we have been programming our autonomous. We are using two Quad Encoders for the lift. They work fine when told to raise until a value is reached, however, it will not work when going to a negative number. Does anyone know a fix to this problem?
I’m wondering what happens if the reading on your encoder counts is going by so fast the code doesn’t update the count fast enough and therefore doesn’t “see” -50 but only sees -55… -56… or whatever. Is that possible?
My kids recently had something like that happen. After hours of trying everything they could think of, they finally shut down their program, restarted their computer, and reloaded the program, re-uploaded their code, and from then on it worked fine.
Lol woops. When you didn’t include the function definitions I doubted my original idea.
In that case its probably what I said. I remember reading about the fancy new easyc blocks that are named very similarly to your function.
The general case functions you wrote really should be less general case. Its not the end of the world to have a lift to height function. This also means your code is easily adaptable to add a P controller later on.
I thought the wait function was yours. I haven’t used those much.
I would also recommend using the sensor names rather than the sensor ports when calling the untilencoder function. This will allow more readable code which is not only good for us but actually good for you debugging as well.