Skip to content

Commit

Permalink
Updated documentation for RM2 Wireless
Browse files Browse the repository at this point in the history
  • Loading branch information
ZodiusInfuser committed Dec 16, 2024
1 parent 8fb6c64 commit dc26b9a
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ To take Yukon further, the full API for the library is described in the followin
* [Docs: LED Strip Module](/docs/modules/led_strip.md)
* [Docs: Quad Servo Direct Module](/docs/modules/quad_servo_direct.md)
* [Docs: Quad Servo Regulated Module](/docs/modules/quad_servo_reg.md)
* [Docs: RM2 Wireless Module](/docs/modules/rm2_wireless.md)
* [Docs: Serial Bus Servo Module](/docs/modules/serial_servo.md)
* [Docs: Yukon Module](/docs/modules/yukon_module.md)
* [Docs: Custom Module](/docs/modules/custom_module.md)
Expand Down
6 changes: 4 additions & 2 deletions docs/module_detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,11 @@ Here is the current address list for Yukon modules produced by Pimoroni.
<tr style="border-top: 2px solid; background-color:rgba(128, 128, 128, 0.25);">
<td>LOW</td><td>LOW</td><td>1</td><td>0</td><td>1</td><td>Reserved</td><td></td>
</tr>
<tr style="background-color:rgba(128, 128, 128, 0.25);">
<td>LOW</td><td>FLOAT</td><td>1</td><td>0</td><td>1</td><td>Reserved</td><td></td>
<!-- RM2 Wireless -->
<tr style="background-color:rgba(244, 204, 204, 0.25);">
<td>LOW</td><td>FLOAT</td><td>1</td><td>0</td><td>1</td><td>RM2 Wireless</td><td></td>
</tr>
<!-- Reserved -->
<tr style="background-color:rgba(128, 128, 128, 0.25);">
<td>LOW</td><td>HIGH</td><td>1</td><td>0</td><td>1</td><td>Reserved</td><td></td>
</tr>
Expand Down
76 changes: 76 additions & 0 deletions docs/modules/rm2_wireless.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# RM2 Wireless Module - Library Reference <!-- omit in toc -->

This is the library reference for the [RM2 Wireless Module for Yukon](https://pimoroni.com/yukon).

- [Getting Started](#getting-started)
- [Initialising the Module](#initialising-the-module)
- [Reference](#reference)
- [Constants](#constants)
- [Functions](#functions)


**:information-source: Wireless is a baked-in feature of MicroPython, so the normal import and initialisation steps for Yukon modules are not strictly required to get your project online. There are still some advantages to doing these though, so the steps are explained below.**

## Getting Started

To start using a Wireless Module, you first need to import the class from `pimoroni_yukon.modules`.

```python
from pimoroni_yukon.modules import WirelessModule
```

Then create an instance of `WirelessModule`. This will also confirm that you have a wireless capable build flashed to your Yukon.

```python
module = WirelessModule()
```


## Initialising the Module

As with all Yukon modules, `WirelessModule` 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.

```python
from pimoroni_yukon import SLOT5 as SLOT # Only SLOT5 supports the RM2 Wireless Module at present

# Import and set up Yukon and WirelessModule instances

yukon.register_with_slot(module, SLOT)
```

Then `Yukon` can verify and initialise its modules.

```python
yukon.verify_and_initialise()
```

This checks each slot on the board to see if the modules expected by your program are physically attached to the board. Only if they match will the `WirelessModule` be initialised.

The RM2 Wireless Module is now ready to use. It can be interacted with using Micropython's `network` libraries, see Raspberry Pi's [Pico W tutorial](https://projects.raspberrypi.org/en/projects/get-started-pico-w/2).

From here you can optionally provide power to all your other modules by calling.
```python
yukon.enable_main_output()
```


## Reference

### Constants

```python
NAME = "RM2 Wireless"
```


### Functions

```python
# Address Checking
@staticmethod
is_module(adc1_level: int, adc2_level: int, slow1: bool, slow2: bool, slow3: bool) -> bool

# Initialisation
WirelessModule()
initialise(slot: SLOT, adc1_func: Callable, adc2_func: Callable) -> None
```

0 comments on commit dc26b9a

Please sign in to comment.