Skip to content

Commit 509421c

Browse files
committed
2 parents 20233e8 + f04d5e8 commit 509421c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/simplefoc_library/code/sensors/magnetic/magnetic_sensor_spi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Finally after the configuration the only thing you need to do is to call the `in
3838
```cpp
3939
MagneticSensorSPI sensor = MagneticSensorSPI(10, 14, 0x3FFF);
4040

41-
void loop(){
41+
void setup(){
4242
...
4343
sensor.spi_mode = SPI_MODE0; // spi mode - OPTIONAL
4444
sensor.clock_speed = 500000; // spi clock frequency - OPTIONAL
@@ -52,7 +52,7 @@ If you wish to use more than one magnetic sensor, make sure you connect their `c
5252
MagneticSensorSPI sensor1 = MagneticSensorSPI(10, 14, 0x3FFF);
5353
MagneticSensorSPI sensor1 = MagneticSensorSPI(9, 14, 0x3FFF);
5454

55-
void loop(){
55+
void setup(){
5656
...
5757
sensor1.init();
5858
sensor2.init();
@@ -171,4 +171,4 @@ void loop() {
171171
Serial.print("\t");
172172
Serial.println(as5047u.getVelocity());
173173
}
174-
```
174+
```

0 commit comments

Comments
 (0)