• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomepcDuinoArduino-ish ProgramGPIOUse Linker 1×2 Button Matrix Module on pcDuino
Previous Next

Use Linker 1×2 Button Matrix Module on pcDuino

Posted by: Alvin Jin , March 30, 2014

[vc_row][vc_column width=”1/1″][vc_column_text]

Linker_buttom_01
Linker 1×2 Button Matrix module has two buttons sized 6x6x5mm. In this project, we will look at how to use it on pcDuino.

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width=”1/1″][vc_tour][vc_tab title=”Parts List” tab_id=”1396165245-1-25″][vc_column_text]

  1. 1 x Linker 1×2 Button Matrix Module
  2. 1 x [bigcommerce link=”/pcduino-v2-an-minipc-with-arduino-headers-ubuntu-android-google/” target=”_blank”]pcDuino V2[/bigcommerce]
  3. 4 x Jumper wires

linker button[/vc_column_text][/vc_tab][vc_tab title=”Wire Diagram” tab_id=”1396165245-2-6″][vc_column_text]Linker Buttonv2 S1  =>  pcDuino D2

Linker Buttonv2  S2   =>  pcDuino D3

Linker Buttonv2  G    => pcDuino GND

Linker Buttonv2  V    => pcDuino +3v

Linker button2[/vc_column_text][/vc_tab][vc_tab title=”Code” tab_id=”1396166934619-2-9″][vc_column_text]

#include  “core.h”

const int button_s1 = 2;

const int button_s2 = 3;

void setup  (){

pinMode (2, INPUT);

pinMode (3, INPUT);

}

void loop  (){

if  (digitalRead (2){

printf (“button_s1 have been hold down!\n”);

}

delay (50);

if  (digitalRead (3){

printf (“button_s2 have been hold down!\n”);

}

delay (50);

}

[/vc_column_text][/vc_tab][vc_tab title=”Test Result ” tab_id=”1396166976465-3-7″][vc_column_text]Press the S1, display “button_S1 have been hold down!”
Press the S2, display “button_S2 have been hold down!”

Linker button3[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]

Tags: GPIO

Share!
Tweet

Alvin Jin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors