Update AS5040.cpp

Major changes throughout, filled in read_chip to make it work, filled in error.