I have an issue with my flywheel motor, number 6 randomly disconnecting from the brain and the flywheel not working correctly.
I would like to have some sort of rumble and alert on the controller to let me know if a motor has disconnected, and which one has disconnected, just by showing a number or something. On the controller. I just figured out rumble, and I know how to type something on the controller, the hard part is getting the brain to tell you that the motor is disconnected.
Keep in mind that I am using block code, and I don’t really care how long the code is to get it to work.
A way to not need to make this, (as I’m pretty sure it is not possible), is to just switch the port or wire of the motor so that a disconnect doesn’t happen.
Hope this helps, will be happy to help with anything else!
- Henry 344E
I know you can definitely do that, In fact port 1 on the brain was dead, so my drivetrain is actually motors 2,3,4, and 9. This is because I ran out of holes on the top of the brain, and the bottom of the brain is very out of the way and low to the ground, so It’s not exactly an option for plugging things into. I kinda just want a way to tell when it disconnects so I know not to use they flywheels during a match so i don’t damage them.
No,
Ports 2,3,4,9 are drivetrain
Port 8 is the intake
Port 6 and 7 are the flywheels
Port 5 is the indexer
Port 1 and 10 are both dead
The one on the side is the radio (21?)
The installed() motor class member function will tell you if a motor is installed on a particular port. example of use.
while(1) {
for(int port=PORT1;port<PORT22;port++) {
vex::motor m(port);
if( m.installed() ) {
// do something with a detected motor
}
else {
// no motor on this port
}
}
this_thread::sleep_for(100);
}