builtin_button - wolfen351/public-micropython-iot-platform GitHub Wiki

The builtin_button module is designed to expose the functionality in the built in button on many of these development boards like the S2 Mini. It sends the fact that the button is pressed as telemetry.

UI

Currently, the status of the built in button is not displayed on the UI.

Hardware / Pinout

The hardware is usually already soldered to the main board. This is designed to allow the user to assign a function to the button. The pinout is board specific, and can be found in the documentation for the board.

Configuration

This module is configured by setting the builtinButton key in the profile.json file. The value of this key is a dictionary with the following keys:

Built In Button Config

"builtinButton": {
    "pin": 0
},

The pin key is the GPIO pin that the button is connected to.

Image from the S2 Mini: image

S2 Mini documentation: https://www.wemos.cc/en/latest/s2/s2_mini.html

Telemetry provided

The main point of this module is to provide telemetry showing the current state of the button. It provides this as telemetry on each cycle.

def getTelemetry(self):
    return { 'button/onboard': self.value }

Telemetry consumed

This module consumes no telemetry from other modules.

Commands provided

This module does not provide any commands to other modules. It only provides telemetry about the button state.

Commands consumed

This module does not consume any commands from other modules.

⚠️ **GitHub.com Fallback** ⚠️