Hi All
I'm working on a school project and part of it has to sense the rotation angle of a continous rotation servo motor.
I use the AS5040 for that purpose but up to this point i suspect my coding has a problem as it does not give me accurate readings.
Has anybody ever tried to work on a similar project? your advise is welcome.
I've connected my pins as bellow
Pin 4 (Arduino)= DO (Synchronous serial interface) AS5040
Pin 7 (Arduino)= CLK 5040
Pin 8 (Arduino)= CSN AS5040
So the CSN has to go low and high for data to start clock out
then the CLK is shifting one bit at time everytime it goes high...the angular position is available as a 10 bit packet info
attached is my code and the AS5040 Datasheet (Page 10 gives more details on SSI of pin 9)
Regards