Product Description
Electronic Brick - LED_Button is a LED inside button module. If it is connected in a circuit, the LED always ON.
The Price is for One Button instead of Five
Features
-
Working Voltage: 3.3V-5V
-
Different color of LED for choice
-
With Makerduino Demo Code
-
Compact size
-
Weight: 3g
Applications
-
Control in dark environment
Details

Use with Makerduino
The following steps show how to use EB - LED Button with Makerduino.
Materials
-
Makerduino
-
Electronic Brick Shield
-
EB - LED Button
-
A/B type USB cable
-
Female DuPont wires
Steps
1. Connect Electronic Brick Shield onto Makerduino to bring out all the Makerduino Pins.

2. Connect EB - LED Button to Makerduino as following:

3. Connect the Makerduino to Computer by the USB cable.
4. Download the Makerduino demo code EB - LED Button.zip. Unzip the code directly into the libraries folder.
5. Open Makerduino IDE, choose the right Board and Serial Port. Open the sketch EB_LED_Button.ino and upload it to the Makerduino.
The following is the demo code for EB - LED Button. (Note: It could be a little different from the code file downloaded. Please follow the downloaded file.)
/*
EB - LED Button demo code
Detect the state of a LED Button and output the information on Serial Monitor
*/
volatile int state = LOW;
void setup()
{
Serial.begin(9600);
attachInterrupt(1, pushButton, RISING);//once button been pushed, function pushButton() will be executed
}
void loop()
{
Serial.println(state);
}
void pushButton()
{
state = !state;//global veriable changes it's state once button pushed
}
6. Check the Results. After the sketch is successfully uploaded, let's open the Serial Monitor. The Serial Monitor displays information as left picture at first. Every time the button pressed, the output changes information as right picture.
Download information
https://drive.google.com/?usp=folder&authuser=0&usp=folder#folders/0BzxrU4QvH7jEd3ZJTVdnNUpXNVE
Find EB - LED Button Material.zip to download schematic and other material.


This product was added to our catalog on Tuesday 11 February, 2014.