2021-05-30, 07:07 AM
Thank you so much for your help! I will be back with the results on the PWM clutch soon.
I am pairing this Pypilot installation with the Neco drive that already has built-in end switches and a rudder position potentiometer. The end switches short out when the end of travel is reached, so they work just the other way than your code was written. I have deleted the exclamation mark in your code as follows:
Altered code:
// test fault pins
if(digitalRead(port_fault_pin)) {
stop_port();
flags |= PORT_PIN_FAULT;
} else
flags &= ~PORT_PIN_FAULT;
if(digitalRead(starboard_fault_pin)) {
stop_starboard();
flags |= STARBOARD_PIN_FAULT;
} else
flags &= ~STARBOARD_PIN_FAULT;
Original code:
// test fault pins
if(!digitalRead(port_fault_pin)) {
stop_port();
flags |= PORT_PIN_FAULT;
} else
flags &= ~PORT_PIN_FAULT;
if(!digitalRead(starboard_fault_pin)) {
stop_starboard();
flags |= STARBOARD_PIN_FAULT;
} else
flags &= ~STARBOARD_PIN_FAULT;
I am pairing this Pypilot installation with the Neco drive that already has built-in end switches and a rudder position potentiometer. The end switches short out when the end of travel is reached, so they work just the other way than your code was written. I have deleted the exclamation mark in your code as follows:
Altered code:
// test fault pins
if(digitalRead(port_fault_pin)) {
stop_port();
flags |= PORT_PIN_FAULT;
} else
flags &= ~PORT_PIN_FAULT;
if(digitalRead(starboard_fault_pin)) {
stop_starboard();
flags |= STARBOARD_PIN_FAULT;
} else
flags &= ~STARBOARD_PIN_FAULT;
Original code:
// test fault pins
if(!digitalRead(port_fault_pin)) {
stop_port();
flags |= PORT_PIN_FAULT;
} else
flags &= ~PORT_PIN_FAULT;
if(!digitalRead(starboard_fault_pin)) {
stop_starboard();
flags |= STARBOARD_PIN_FAULT;
} else
flags &= ~STARBOARD_PIN_FAULT;