updated
This commit is contained in:
@@ -72,9 +72,11 @@ void ppmOnEdge(int gpio, int level, uint32_t tick)
|
|||||||
|
|
||||||
// RC output
|
// RC output
|
||||||
for (int i = 0; i < ppmChannelsNumber; i++) {
|
for (int i = 0; i < ppmChannelsNumber; i++) {
|
||||||
// Sanity checks for values
|
// Because we aren't going to get exact readings as this may not be running with a RT kernel
|
||||||
if( channels[i] > 2000 ) channels[i] = 2000;
|
// We need to add some sanity checks for values
|
||||||
if( channels[i] < 1000 ) channels[i] = 1000;
|
if( channels[i] > 2000 ) channels[i] = 2000; // Set top forward speed
|
||||||
|
if( channels[i] < 1000 ) channels[i] = 1000; // Set top reverse speed
|
||||||
|
if( channels[i] < 1550 && channels[i] > 1450 ) channels[i] = 1500; // Add a dead band around center
|
||||||
// Set motor speed
|
// Set motor speed
|
||||||
motors[i]->setMotorSpeed( channels[i] );
|
motors[i]->setMotorSpeed( channels[i] );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user