[vc_row][vc_column width=”1/1″][vc_column_text]
Linker butten is the button,the module has two versions, There are two buttons, the big one is a single button, another is the double button.Take the single button as an example.
linker butten on the circuit, is the most simple input device, but also the most used input device, In this example, the button is used to control LED lights bright and dark.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width=”1/1″][vc_tour][vc_tab title=”Hardware required” tab_id=”1392718710-1-81″][vc_column_text]The components used in this experiment are shown below:
The components are one LED light, five Male to Female Dupont Line, one linker butten, and one pcduino.
[/vc_column_text][/vc_tab][vc_tab title=”Hardware connection” tab_id=”1392718710-2-79″][vc_column_text]The GND pin of LED is connected to pcduino GND pin, and the SIG pin of LED is connected to GPIO 8 pin,and the GND pin of linker butten is connected to GND pin of pcduino, and the VCC pin of linker butten is connected to 5V pin of pcduino, and the SIG pin of linker butten is connected to GPIO 9 pin of pcduino.
[/vc_column_text][/vc_tab][vc_tab title=”Test Running” tab_id=”1392719395687-2-0″][vc_column_text]Release the button ,led off, press the button ,led lights[/vc_column_text][vc_gallery type=”flexslider_fade” interval=”3″ images=”2955,2956″ onclick=”link_image” custom_links_target=”_self”][/vc_tab][vc_tab title=”Test code” tab_id=”1392719595671-3-3″][vc_column_text]int led_pin=8;
int butten_pin=9;
void setup() {
// put your setup code here, to run once:
pinMode(led_pin,OUTPUT);
pinMode(butten_pin,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(led_pin,digitalRead(butten_pin));
}
//Release the button ,LED off, press the button ,LED lights[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.