Questions about the as5600 code

#include <SimpleFOC.h>

// MagneticSensorI2C(uint8_t _chip_address, float _cpr, uint8_t _angle_register_msb)
// chip_address I2C chip address
// bit_resolution resolution of the sensor
// angle_register_msb angle read register msb
// bits_used_msb number of used bits in msb register
//
// make sure to read the chip address and the chip angle register msb value from the datasheet
// also in most cases you will need external pull-ups on SDA and SCL lines!!!
//
// For AS5058B
// MagneticSensorI2C sensor = MagneticSensorI2C(0x40, 14, 0xFE, 8);

// Example of AS5600 configuration
MagneticSensorI2C sensor = MagneticSensorI2C(AS5600_I2C);

void setup() {
// monitoring port
Serial.begin(115200);

// configure i2C
Wire.setClock(400000);
// initialise magnetic sensor hardware
sensor.init();

Serial.println(“Sensor ready”);
_delay(1000);
}

void loop() {
// iterative function updating the sensor internal variables
// it is usually called in motor.loopFOC()
// this function reads the sensor hardware and
// has to be called before getAngle nad getVelocity
sensor.update();

// display the angle and the angular velocity to the terminal
Serial.print(sensor.getAngle());
Serial.print(“\t”);
Serial.println(sensor.getVelocity());
}

When using this code the motor is stationary but not moving.
What’s the matter?

Hey, @a01047047186 , welcome to SimpleFOC!

Stationary and not moving?

This is code to test the sensor. You have to move the motor by hand, then if everything is set up right you’ll see the values change on the serial port…

I didn’t upload the code well. There are other posts, could you please take a look?

Perhaps if you rephrase/redo the question that would help.