Skip to content

Commit

Permalink
Module readme tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
ZodiusInfuser committed Nov 2, 2023
1 parent 588abef commit 5d4b613
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 7 deletions.
2 changes: 2 additions & 0 deletions docs/modules/audio_amp.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ AMP_I2C_ADDRESS = 0x38
TEMPERATURE_THRESHOLD = 50.0
```


### Variables

```python
player: WavPlayer
```


### Functions

```python
Expand Down
5 changes: 4 additions & 1 deletion docs/modules/bench_power.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Power can now be provided to all modules, by calling.
yukon.enable_main_output()
```


## Using the Module

### Controlling its Output
Expand Down Expand Up @@ -94,9 +95,10 @@ VOLTAGE_MID_MEASURE = 1.1706
VOLTAGE_MAX_MEASURE = 2.2007
PWM_MIN = 0.3
PWM_MAX = 0.0
TEMPERATURE_THRESHOLD = 70.0
TEMPERATURE_THRESHOLD = 80.0
```


### Variables

```python
Expand All @@ -106,6 +108,7 @@ FAST3 = Pin
FAST4 = Pin
```


### Methods

```python
Expand Down
7 changes: 6 additions & 1 deletion docs/modules/big_motor.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ Power can now be provided to all modules, by calling.
yukon.enable_main_output()
```


## Using the Module

### Enabling its Driver

With the `BigMotorModule` powered, its motor driver can be enabled or disabled by calling `.enable()` or `.disable()`. The state can also be queried by calling `.is_enabled()`.


### Accessing the Motor

The `BigMotorModule` class makes use of the [Motor Library](https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/modules/motor/README.md).
Expand Down Expand Up @@ -131,6 +133,7 @@ For example, to read the current angle of the encoder, the following line of cod
angle = module.encoder.degrees()
```


#### Direct GPIO Access

If your project does not need an encoder, then the pins on Big Motor + Encoder Module can be made available as GPIO. During creation of the `BigMotorModule`, instruct it to *not* create the encoder object, by providing it with the `init_encoder=False` parameter. Other encoder specific parameters, such as the PIO and SM, can also be omitted.
Expand Down Expand Up @@ -160,12 +163,13 @@ NAME = "Big Motor + Encoder"
NUM_MOTORS = 1
DEFAULT_FREQUENCY = 25000
DEFAULT_COUNTS_PER_REV = MMME_CPR # 12
TEMPERATURE_THRESHOLD = 50.0
TEMPERATURE_THRESHOLD = 80.0
CURRENT_THRESHOLD = 25.0
SHUNT_RESISTOR = 0.001
GAIN = 80
```


### Variables

```python
Expand All @@ -182,6 +186,7 @@ encoder: Encoder
encoder_pins: tuple[Pin, Pin]
```


### Methods

```python
Expand Down
6 changes: 6 additions & 0 deletions docs/modules/dual_motor.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module = DualMotorModule(MOTOR_TYPE,
FREQUENCY)
```


### Motor Types

The `DualMotorModule` can drive both 2x brushed DC motors, or 1x bipolar stepper motor. The type of motor driven can be chosen using the following constants:
Expand Down Expand Up @@ -73,6 +74,7 @@ Power can now be provided to all modules, by calling.
yukon.enable_main_output()
```


## Using the Module

### Enabling its Driver
Expand Down Expand Up @@ -169,9 +171,11 @@ The Dual Motor / Bipolar Stepper module features an onboard thermistor, letting

Additionally, the fault state of the motor driver can be read by calling `.read_fault()`. This will be `False` during normal operation, but will switch to `True` under various conditions. For details of these conditions, check the [DRV8424P datasheet](https://www.ti.com/lit/ds/symlink/drv8424e.pdf).


## References

### Constants

```python
NAME = "Dual Motor"
DUAL = 0
Expand All @@ -198,6 +202,7 @@ DEFAULT_CURRENT_LIMIT = CURRENT_LIMIT_3
MAX_CURRENT_LIMIT = CURRENT_LIMIT_9
```


### Variables

```python
Expand All @@ -208,6 +213,7 @@ motors: list[Motor]
motor_pins: tuple[tuple[Pin, Pin], tuple[Pin, Pin]]
```


### Functions

```python
Expand Down
4 changes: 3 additions & 1 deletion docs/modules/dual_output.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ This is the library reference for the [Dual Switched Output Module for Yukon](ht
- [Functions](#functions)



## Getting Started

To start using a Dual Switched Output Module, you first need to import the class from `pimoroni_yukon.modules`.
Expand Down Expand Up @@ -69,6 +68,7 @@ For convenience the constants `OUTPUT_1 = 0` and `OUTPUT_2 = 0` are provided.

:information_source: **Enabling a switch does not produce an output on its own. Rather, it "unlocks" the switch to respond to commands.**


### Accessing the Outputs

The `DualOutputModule` class uses MicroPython's native [Pin class](https://docs.micropython.org/en/latest/library/machine.Pin.html) for its outputs. To Pin objects are created and made accessible through the `.outputs` list.
Expand Down Expand Up @@ -108,13 +108,15 @@ NUM_OUTPUTS = 2
TEMPERATURE_THRESHOLD = 50.0
```


### Variables
```python
halt_on_not_pgood: bool

outputs: list[Pin]
```


### Functions

```python
Expand Down
10 changes: 9 additions & 1 deletion docs/modules/led_strip.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module = LEDStripModule(STRIP_TYPE,

:warning: **Be sure to choose a PIO and State Machine that does not conflict with any others you have already set up.**


### Strip Types

Both WS2812's (aka NeoPixels) and APA102's (aka DotStars) are supported by the `LEDStripModule`.
Expand All @@ -56,6 +57,7 @@ Strip types can accessed with the following constants:

When using the `DUAL_NEOPIXEL` strip type, the lengths of the two strips can be provided as a tuple pair as the `LEDS_PER_STRIP` constant from the getting started section, or left as a single value if both strips are the same length.


## Initialising the Module

As with all Yukon modules, `LEDStripModule` must be initialised before it can be used. This is achieved by first registering the module with the `Yukon` class, with the slot it is attached to.
Expand All @@ -82,12 +84,14 @@ Power can now be provided to all modules, by calling.
yukon.enable_main_output()
```


## Using the Module

### Enabling its Output

With the `LEDStripModule` powered, its output to the strip(s) can be enabled or disabled by calling `.enable()` or `.disable()`. The state can also be queried by calling `.is_enabled()`.


### Accessing the LED Strip

The `LEDStripModule` class makes use of the [Plasma Library](https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/modules/plasma/README.md). Depending on the strip type provided during creation, either an APA102 objects or WS2812 objects will be accessible through the variable `.strip`.
Expand All @@ -103,6 +107,7 @@ module.strip.update()

For the case of the `DUAL_NEOPIXEL` strip type, a `.strips` list is accessible containing two WS2812 objects, instead of a `.strip` variable. There are also `.strip1` and `.strip2` properties to make access to these strips easier.


### Onboard Sensors

The LED Strip module features an onboard thermistor, letting its temperature be monitored. This can be read by calling `.read_temperature()`.
Expand All @@ -122,10 +127,12 @@ DOTSTAR = 2
STRIP_1 = 0 # Only for DUAL_NEOPIXEL strip_type
STRIP_2 = 1 # Only for DUAL_NEOPIXEL strip_type
NUM_STRIPS = 1 # Becomes 2 with the DUAL_NEOPIXEL strip_type
TEMPERATURE_THRESHOLD = 70.0
TEMPERATURE_THRESHOLD = 80.0
```


### Variables

```python
halt_on_not_pgood: bool

Expand All @@ -136,6 +143,7 @@ strip: APA102 | WS2812
strips: list[WS2812]
```


### Functions

```python
Expand Down
4 changes: 4 additions & 0 deletions docs/modules/quad_servo_direct.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Power can now be provided to all modules, by calling.
yukon.enable_main_output()
```


## Using the Module

### Accessing the Servos
Expand All @@ -74,6 +75,7 @@ It is also possible to access the servos individually using the properties `.ser

Up to four modules, for a total of 16 servos, can be used in this way, provided their PWM pins do not conflict. Refer to the [Yukon Pinout Diagram](../yukon_pinout_diagram.png) for the slots you are using.


#### More than 16 Servos

To drive more than 16 servos, or use slots that would normally have conflicting PWMs, a [ServoCluster](https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/modules/servo/README.md#servocluster) object should to be used.
Expand Down Expand Up @@ -123,6 +125,7 @@ SERVO_4 = 3
NUM_SERVOS = 4
```


### Variables
```python
# If init_servos was True
Expand All @@ -132,6 +135,7 @@ servos: list[Servo]
servo_pins: tuple[Pin, Pin, Pin, Pin]
```


### Functions

```python
Expand Down
10 changes: 7 additions & 3 deletions docs/modules/quad_servo_reg.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ This is the library reference for the [Quad Servo Regulated Module for Yukon](ht
- [Functions](#functions)



## Getting Started

To start using a Quad Servo Regulated Module, you first need to import the class from `pimoroni_yukon.modules`.
Expand Down Expand Up @@ -57,12 +56,14 @@ Power can now be provided to all modules, by calling.
yukon.enable_main_output()
```


## Using the Module

### Enabling its Output

With the `QuadServoRegModule` powered, its output to the servos can be enabled or disabled by calling `.enable()` or `.disable()`. The state can also be queried by calling `.is_enabled()`.


### Accessing the Servos

The `QuadServoRegModule` class makes use of the [Servo Library](https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/modules/servo/README.md).
Expand All @@ -80,6 +81,7 @@ It is also possible to access the servos individually using the properties `.ser

Up to four modules, for a total of 16 servos, can be used in this way, provided their PWM pins do not conflict. Refer to the [Yukon Pinout Diagram](../yukon_pinout_diagram.png) for the slots you are using.


#### More than 16 Servos

To drive more than 16 servos, or use slots that would normally have conflicting PWMs, a [ServoCluster](https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/modules/servo/README.md#servocluster) object should to be used.
Expand Down Expand Up @@ -127,9 +129,10 @@ SERVO_2 = 1
SERVO_3 = 2
SERVO_4 = 3
NUM_SERVOS = 4
TEMPERATURE_THRESHOLD = 70.0
TEMPERATURE_THRESHOLD = 80.0
```


### Variables
```python
halt_on_not_pgood: bool
Expand All @@ -141,6 +144,7 @@ servos: list[Servo]
servo_pins: tuple[Pin, Pin, Pin, Pin]
```


### Functions

```python
Expand Down Expand Up @@ -178,4 +182,4 @@ monitor() -> None
get_readings() -> OrderedDict
process_readings() -> None
clear_readings() -> None
```
```

0 comments on commit 5d4b613

Please sign in to comment.