Skip to content

Commit d6e6000

Browse files
author
Richard Unger
committed
MA730 docs fixes
1 parent 67bd70e commit d6e6000

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/encoders/ma730/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ void setup() {
3535
Set some options:
3636

3737
```c++
38-
MagneticSensorMA730 sensor1(SENSOR1_CS, true, mySPISettings);
38+
MagneticSensorMA730 sensor1(SENSOR1_CS, mySPISettings);
3939
```
4040
4141
Use another SPI bus:
4242
4343
```c++
4444
void setup() {
45-
sensor1.init(SPI2);
45+
sensor1.init(&SPI2);
4646
}
4747
```
4848

@@ -63,4 +63,12 @@ Here's how you can use it:
6363

6464
// get the raw 14 bit value
6565
uint16_t raw = sensor1.readRawAngle();
66+
67+
// get the field strength
68+
FieldStrength fs = sensor1.getFieldStrength();
69+
Serial.print("Field strength: ");
70+
Serial.println(fs);
71+
72+
// set pulses per turn for encoder mode
73+
sensor1.setPulsesPerTurn(1000); // if we want 1000 PPR == 4000 CPR
6674
```

0 commit comments

Comments
 (0)