simplefoc / Arduino-FOC-drivers

Drivers and support code for SimpleFOC
https://docs.simplefoc.com/drivers_library
MIT License
146 stars 63 forks source link

Error in sample code? #3

Closed steph643 closed 2 years ago

steph643 commented 3 years ago

The doc says:

    // check for errors
    if (!sensor1.isErrorFlag()) {
        AS5048Error error = sensor1.clearErrorFlag();
        if (error.parityError) { // also error.framingError, error.commandInvalid
            // etc...            
        }
    }

Are you sure it's not if (sensor1.isErrorFlag()) instead?

runger1101001 commented 2 years ago

😊 fixed