Skip to content

Commit

Permalink
update simplefocnanodriver docs
Browse files Browse the repository at this point in the history
  • Loading branch information
runger1101001 committed Jun 3, 2024
1 parent 9952f3b commit ff2fb84
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.project
.DS_Store
src/encoders/esp32hwencoder.bak/
15 changes: 14 additions & 1 deletion src/drivers/simplefocnano/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ void loop(){
}
```

### Additional functions

There are some extra features, you can check for faults, and clear the fault state:

```c++
Expand All @@ -50,6 +52,8 @@ if (driver.isSleeping())
driver.wake();
```

### Bus Voltage Sense

As shown in the example you can read the bus voltage:

:warning: *this is a slow function. Do not call it while motor is running!*
Expand All @@ -58,8 +62,17 @@ As shown in the example you can read the bus voltage:
float val = driver.getBusVoltage(); // get the bus voltage, in Volts
```

### SPI port

The driver's nCS pin is 10, and the constant PIN_nCS can be used:

```c++
MagneticSensorAS5048A sensor = MagneticSensorAS5048A(PIN_nCS);
```
```

## Examples

The following examples for SimpleFOCNanoDriver can be found in our examples directory:

- [SimpleFOC Nano on AVR](https://github.com/simplefoc/Arduino-FOC-drivers/blob/master/examples/drivers/simplefocnano/simplefocnano_atmega/simplefocnano_atmega.ino) (5V, 10bit ADC range, like original Nano, using AS5048A sensor on SPI)
- [SimpleFOCNanoDriver torque-voltage mode](https://github.com/simplefoc/Arduino-FOC-drivers/blob/master/examples/drivers/simplefocnano/simplefocnano_torque_voltage/simplefocnano_torque_voltage.ino) (3.3V, 12bit ADC range, using AS5048A sensor on SPI)

0 comments on commit ff2fb84

Please sign in to comment.