changes readError to readData, and use it to read motor state values as well
adds functions to read motor state values