

The WeMos D1 Mini 1 Button Shield is a compact and versatile add-on designed specifically for the WeMos D1 Mini development board. It features a single tactile push button that can be used for various input functions in IoT and electronics projects. This shield is ideal for triggering actions, controlling devices, or providing user input in a simple and efficient manner.








The WeMos D1 Mini 1 Button Shield is designed to integrate seamlessly with the WeMos D1 Mini. Below are its key technical details:
The shield connects directly to the WeMos D1 Mini, and the button is internally wired to a specific GPIO pin. Below is the pin configuration:
| Pin | Description |
|---|---|
| D3 | GPIO pin connected to the button |
| GND | Ground connection |
| 3V3 | Power supply (3.3V) |
Note: The button is connected to GPIO D3 by default. Pressing the button pulls the pin LOW (active LOW configuration).
Below is an example code snippet for using the WeMos D1 Mini 1 Button Shield with the Arduino IDE:
// Example code for WeMos D1 Mini 1 Button Shield
// This code detects button presses and toggles an LED on GPIO D4
#define BUTTON_PIN D3 // GPIO pin connected to the button
#define LED_PIN D4 // GPIO pin connected to an LED
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP); // Set button pin as input with pull-up resistor
pinMode(LED_PIN, OUTPUT); // Set LED pin as output
digitalWrite(LED_PIN, LOW); // Initialize LED as OFF
Serial.begin(9600); // Initialize serial communication
}
void loop() {
// Read the button state (LOW when pressed, HIGH when not pressed)
int buttonState = digitalRead(BUTTON_PIN);
if (buttonState == LOW) {
// Button is pressed
Serial.println("Button Pressed!");
digitalWrite(LED_PIN, HIGH); // Turn LED ON
delay(500); // Debounce delay
} else {
// Button is not pressed
digitalWrite(LED_PIN, LOW); // Turn LED OFF
}
}
Note: The
INPUT_PULLUPmode enables the internal pull-up resistor, ensuring the pin is not left floating.
Button Not Responding:
False Triggers or Multiple Signals:
Floating Pin Issues:
INPUT_PULLUP mode is enabled in your code to activate the internal pull-up resistor.Button Feels Stiff or Unresponsive:
By following this documentation, you can effectively integrate the WeMos D1 Mini 1 Button Shield into your projects and troubleshoot any issues that arise.