Hey guys.
I'm writing a high-speed rotary encoder for Teensy 4.0 and as I'm sure you guessed, running into issues.
my code is this:
I'm using Teensy 4.0, it's in 24mhz mode.
The pin diagram is as follows:
Teensy -> AS5047
5V -> 5V
Gnd ->
Pin10 -> CSn
Pin11-> CLK
Pin12-> MOSI
Pin13-> MISO
Picture:
Now, on the standard arduino board I uploaded this to, the serial monitor outputted values from 0 to 360 as expected as the magnet rotated, as expected. However, in the teensy 4.0 there is only 0 values coming down. The debug system also reported 0 values on everything.
Anyway, I would appreciate assistance figuring this out. Thanks a lot!
I'm writing a high-speed rotary encoder for Teensy 4.0 and as I'm sure you guessed, running into issues.
my code is this:
Code:
// Include the library
#include <AS5X47.h>
// Define where the CSN Pin in connected.
int slaveSelectPin = 10;
// Start connection to the sensor.
AS5X47 as5047p(slaveSelectPin);
void setup() {
// Initialize a Serial Communication in order to
// print the measured angle.
Serial.begin(9600);
}
void loop() {
// Read the measured angle
float angle = as5047p.readAngle();
// Show the measure angle on the Serial Port
Serial.println(angle);
// Wait 1 second (1000 milliseconds) before reading again.
delay(1000);
}
I'm using Teensy 4.0, it's in 24mhz mode.
The pin diagram is as follows:
Teensy -> AS5047
5V -> 5V
Gnd ->
Pin10 -> CSn
Pin11-> CLK
Pin12-> MOSI
Pin13-> MISO
Picture:
Now, on the standard arduino board I uploaded this to, the serial monitor outputted values from 0 to 360 as expected as the magnet rotated, as expected. However, in the teensy 4.0 there is only 0 values coming down. The debug system also reported 0 values on everything.
Anyway, I would appreciate assistance figuring this out. Thanks a lot!