Commit 697ac018 authored by Torbjørn Ludvigsen's avatar Torbjørn Ludvigsen 👷

Changes encoder from AS5047D to AS5048A

parent 4039c188
......@@ -28,8 +28,8 @@ void setupPins() {
void setupSPI() {
SPISettings settingsA(10000000, MSBFIRST, SPI_MODE1);
SPI.begin(); //AS5047D SPI uses mode=1 (CPOL=0, CPHA=1)
SerialUSB.println("Beginning SPI communication with AS5047 encoder...");
SPI.begin();
SerialUSB.println("Beginning SPI communication with AS5048 encoder...");
delay(1000);
SPI.beginTransaction(settingsA);
}
......@@ -435,11 +435,11 @@ void readEncoderDiagnostics() {
CHIPSELECT_LOW();
SerialUSB.println("------------------------------------------------");
SerialUSB.println("Checking AS5047 diagnostic and error registers");
SerialUSB.println("See AS5047 datasheet for details");
SerialUSB.println("Checking AS5048 diagnostic and error registers");
SerialUSB.println("See AS5048 datasheet for details");
SerialUSB.println(" ");
SPI.transfer(0xFF);
SPI.transfer(0xFC);
SPI.transfer(0x7F);
SPI.transfer(0xFD);
CHIPSELECT_HIGH();
delay(1);
CHIPSELECT_LOW();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment