Button Wemos shield

2,45

3 in stock

SKU: HE0241-925 Categories: , , Tags: , , Send:

Description

Button Wemos shield. Simple shield with 1 button. Output to pin D3.

Getting started with Wemos D1 mini:
- Wemos D1 mini manual Arduino IDE
- Wemos D1 mini manual NodeMCU
- Drivers

Arduino code example:

/*
 * 1 Button Shield - Simple Push
 * Press the pushbutton to switch on the LED
 *
 * 1 Button Shield pushbutton connects pin D3 to GND
 */

const int buttonPin = D3;
const int ledPin = BUILTIN_LED;

int buttonState = 0;

void setup() {
  pinMode(buttonPin, INPUT);
  pinMode(ledPin, OUTPUT);

  // set initial state, LED off
  digitalWrite(ledPin, buttonState);
}

void loop() {
  // read button state, HIGH when pressed, LOW when not
  buttonState = digitalRead(buttonPin);

  // if the push button pressed, switch on the LED
  if (buttonState == HIGH) {
    digitalWrite(ledPin, HIGH);  // LED on
  } else {
    digitalWrite(ledPin, LOW); // LED off
  }
}

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shipping within the Netherlands

This product will be delivered via PostNL letter post in a bubble envelope.
- €3.45 shipping costs for orders under €25.
- €2.95 shipping costs for orders between €25 - €45.
- Orders above € 45,- will be free of charge sent by PostNL letter post.

  • Ordered before 16:30 PM on workdays, shipped the same day!
    Click here for costs outside the Netherlands.
  • Product question?

      Your Name (required)

      Your Email (required)

      your question