🎁 Final Month Special: 15% OFF + Free Shipping on Most Items! Don't Miss Out - Shop Now! ✨

Shopping Cart

Sub Total: $0.00
Total: $0.00
Checkout

Search Products

M5Stack Mechanical Key Button Unit Image 1
View Media Gallery
M5Stack Mechanical Key Button Unit Image 2
View Media Gallery
M5Stack Mechanical Key Button Unit Image 3
View Media Gallery
M5Stack Mechanical Key Button Unit Image 4
View Media Gallery
M5Stack Mechanical Key Button Unit Image 5
View Media Gallery
M5Stack Mechanical Key Button Unit Image 6
View Media Gallery
M5Stack Mechanical Key Button Unit Image 7
View Media Gallery
M5Stack Mechanical Key Button Unit Image 8
View Media Gallery
M5Stack Mechanical Key Button Unit Image 9
View Media Gallery
M5Stack Mechanical Key Button Unit Nav Image 1
M5Stack Mechanical Key Button Unit Nav Image 2
M5Stack Mechanical Key Button Unit Nav Image 3
M5Stack Mechanical Key Button Unit Nav Image 4
M5Stack Mechanical Key Button Unit Nav Image 5
M5Stack Mechanical Key Button Unit Nav Image 6
M5Stack Mechanical Key Button Unit Nav Image 7
M5Stack Mechanical Key Button Unit Nav Image 8
M5Stack Mechanical Key Button Unit Nav Image 9

M5Stack Mechanical Key Button Unit

$4.99 $5.00


Categories:

Buttons & Switches
Estimated Delivery:
0 people are viewing this right now
Guaranteed Safe Checkout
Trust
Trust
  • Description

The Mechanical Key Button Unit from M5Stack is a single mechanical key input unit with a built-in RGB LED.

The key shaft adopts a Blue switch with a tactile bump and audible click feature. The unit has an embedded programable SK6812 RGB LED and supports 256 level brightness. Two digital IOs are available for key status and LED control key status and lighting control. Suitable for multiple HMI applications.

Features

  • Blue switch with tactile bump and audible click
  • Programable RGB LED - SK6812

Package Contents

  • 1x Unit Key
  • 1x HY2.0 4-pin Cable (20cm)

Specifications

Power Supply DC 5V
Output Logical Signal DC 3.3V
Standby Current DC5V@2mA
Operating current DC5V@13mA
Net weight 7.6g
Gross weight 13.1g
Product Dimensions 40 * 24 * 22.6mm
Package Size 90 * 135mm

Resources

Pinout

M5CORE - PORT B G36 G26
UNIT Key Button Input RGB LED Control

Arduino Example Code

#include 
#include 

uint8_t ledColor = 0;

#define KEY_PIN  36
#define LED_PIN 26

CRGB LED[1];

void setup() {
    M5.begin();
    M5.Lcd.setTextSize(3);
    M5.Lcd.print("\n UNIT-KEY Example\n\n    Key State:");
    /* Init key pin */
    pinMode(KEY_PIN, INPUT_PULLUP);
    /* Init RGB led */
    FastLED.addLeds(LED, 1);
    LED[0] = CRGB::Blue;
    FastLED.setBrightness(0);
}

void loop() {
    /* If Key was pressed */
    if (!digitalRead(KEY_PIN)) {
        M5.Lcd.setCursor(75, 130);
        M5.Lcd.print((" Pressed "));
        FastLED.setBrightness(255);
        FastLED.show();
        /* Hold until the key released */
        while (!digitalRead(KEY_PIN))
            ;
    } else {
        M5.Lcd.setCursor(75, 130);
        M5.Lcd.println(("Released"));
        FastLED.setBrightness(0);
        FastLED.show();
    }
    delay(100);
}