• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomeArduinoShieldsUse Linker 1×2 Button Matrix Module on Arduin ...
Previous Next

Use Linker 1×2 Button Matrix Module on Arduino

Posted by: Alvin Jin , March 27, 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 Arduino.

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

  1. 1 x Linker 1×2 Button Matrix Module
  2. 1 x [bigcommerce link=”/arduino-uno-compatible-usb-board-r3/” target=”_blank”]Arduino Uno[/bigcommerce]
  3. 1 x [bigcommerce link=”/20-cm-cable-for-linker-kit/” target=”_blank”]Linker cable 20mm[/bigcommerce]
  4. 1 x [bigcommerce link=”/base-shield-of-linker-kit-for-pcduino-arduino/” target=”_blank”]Linker base shield[/bigcommerce]

[/vc_column_text][/vc_tab][vc_tab title=”Wiring Diagram” tab_id=”1395584687-2-38″][vc_column_text]Connecting Linker 1×2 Button Matrix module to [D2 D3] position of Linker Base Shield;s [D2 D3] by the Linker 20 mm cable.

Install Linker base shield on Arduino.

Connect Arduino Uno to a PC by USB cable.

Linker_buttom_02[/vc_column_text][/vc_tab][vc_tab title=”Code” tab_id=”1395585544273-2-10″][vc_column_text]

/*************************************************************************
	> File Name: Linker_buttomv2.c
	> Author: Darren 
	> Created Time: Fri Jan  1 00:05:19 2010
 ************************************************************************/

#include "Arduino.h"

const int s1_pin = 3;
const int s2_pin = 2;

void setup(){
	pinMode (s1_pin, INPUT);
	pinMode (s2_pin, INPUT);
        Serial.begin (9600);
}

void loop (){
	if(digitalRead (s1_pin)){
		Serial.println ("button_1 have been hold down!");
	}
	delay (50);
	if(digitalRead (s2_pin)){
		Serial.println ("button_2 have been hold down!");
	}
	delay (50);

}

[/vc_column_text][/vc_tab][vc_tab title=”Test Result” tab_id=”1395585577239-3-10″][vc_column_text]

Press the left button, display “button_2 have been hold down!”
Press the right button, display “button_1 have been hold down!”
linker_button_v2

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

Tags: Shields

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