Mini Button Unit

via M5Stack
$3.96
SKU M5-U027
Description

BUTTON is a single button Unit. The button status can be detected by the input pin status,simply capture the high/low electrical level.

As shown in the figure below:

Output status:

This unit communicates with M5Core through GROVE B port.

Product Features

  • Program Platform: Arduino, UIFlow(Blockly, Python)
  • Two Lego-compatible holes

Kit includes

  • 1x BUTTON Unit
  • 1x Grove Cable
Learn

LEARN

Example

1. Arduino IDE

The code below is incomplete(just for usage). To get the complete code, please click here.

#include <M5Stack.h>

// declaration
int cur_value = 0;

// initialization
M5.begin();// init
pinMode(36, INPUT);// BUTTON Pin

// read data
cur_value = digitalRead(36);// read the value of BUTTON
M5.update();

2. UIFlow

If you want the complete code, please click here.

 

More information

Schematic

PinMap

M5Core(GROVE B) Btn (GPIO36) NC (GPIO26) 5V GND
BUTTON Unit BUTTON Pin / 5V GND