Skip to content

Latest commit

 

History

History
76 lines (48 loc) · 2.33 KB

rm2_wireless.md

File metadata and controls

76 lines (48 loc) · 2.33 KB

RM2 Wireless Module - Library Reference

This is the library reference for the RM2 Wireless Module for Yukon.

: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 RM2 Wireless Module, you first need to import the class from pimoroni_yukon.modules.

from pimoroni_yukon.modules import RM2WirelessModule

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

module = RM2WirelessModule()

Initialising the Module

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

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

# Import and set up Yukon and RM2WirelessModule instances

yukon.register_with_slot(module, SLOT)

Then Yukon can verify and initialise its modules.

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 RM2WirelessModule 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.

From here you can optionally provide power to all your other modules by calling.

yukon.enable_main_output()

Reference

Constants

NAME = "RM2 Wireless"

Functions

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

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