[Diao Ye learns programming] Arduino hands-on (116)---five-way navigation button module

The reference to 37 sensors and actuators has been widely circulated on the Internet. In fact, there must be more than 37 sensor modules compatible with Arduino. In view of the fact that I have accumulated some sensor and actuator modules on hand, according to the concept of practicing true knowledge (must be done), for the purpose of learning and communication, I am going to try a series of experiments one by one, regardless of success (the program goes through) or not, They will be recorded - small progress or unsolvable problems, hoping to inspire others.

[Arduino] 168 sensor module series experiments (data code + simulation programming + graphics programming)

Experiment 116: Five-way navigation button module 5D joystick MCU independent keyboard switch button Your Cee

insert image description here
Five-way tact switch

Also known as multi-function switch or multi-line switch, switch operated in five directions, six-pin with positioning column, patch type, this series has multiple specifications: 10 10 5, commonly known as positive five-way switch, 7*7, commonly known as oblique Five directions, various heights are optional.

insert image description here
Related parameters

Dimensions: 10.0mm 10.0mm 5mm

Parameter configuration: Action force: 160gf/250gf

1.Rating : DC 12V 50mA

  1. Contact Resistance:100mΩMAX

  2. Insulation Resistance:100MΩMIN

  3. Soldering Temper: 260±5°5s

  4. Mechanical Life: 200,000 cycles Min

  5. Electrical Life: 200,000 cycles Min

  6. Ambient Temper.Used: -25 ℃ to 85 ℃

  7. Ambient Humidety Used: 85% RH

  8. Operating Force:

4-direction 160 ± 35 gf

Center push 250 ± 35 gf

insert image description here
insert image description here
insert image description here
The biggest difference of the five-way switch is that it has five contacts. That is, at the inner bottom, there is a central fixed contact and common contact housing, and there is a housing around which there are many peripheral fixed contacts. These housings are placed on movable contact springs. When the machine wants to form a path, it can directly connect the contact spring and the common contact together. The movable contact reeds can be connected together, together with the control of the operating rod, one movable contact reed can be directly connected to its corresponding contact.
insert image description here

The five - way navigation key module is equivalent to 7 independent key switches. One end of the 7 switches is connected to the common
terminal
COM . ——Left” direction key “ RHT—right” direction key “ MID—middle” direction key SET ——“Setting” button RST——“Reset” button output——digital level (press low level, release high level)







insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
Arduino experiment open source code

/*

【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)

实验一百一十六:五向导航按键模块 5D摇杆 单片机 独立键盘开关 按钮 Your Cee

项目:串口打印各端口输入值

说明:2\3\4\5\6\7\8输入为开关量(digitalRead)

*/



int value = 0;



void setup() {
    
    

Serial.begin(9600);

pinMode(2,INPUT);

pinMode(3,INPUT);

pinMode(4,INPUT);

pinMode(5,INPUT);

pinMode(6,INPUT);

pinMode(7,INPUT);

pinMode(8,INPUT);

pinMode(13,OUTPUT);

}



void loop() {
    
    

if (digitalRead(8)) {
    
    

  digitalWrite(13,HIGH);

  }

  else {
    
    

  digitalWrite(13,LOW);

}

value = digitalRead(2);

Serial.print("UP");

Serial.println(value, DEC);

value = digitalRead(3);

Serial.print("DWN");

Serial.println(value, DEC);

value = digitalRead(4);

Serial.print("LFT");

Serial.println(value, DEC);

value = digitalRead(5);

Serial.print("RHT");

Serial.println(value, DEC);

value = digitalRead(6);

Serial.print("MID");

Serial.println(value, DEC);

value = digitalRead(7);

Serial.print("SET");

Serial.println(value, DEC);

value = digitalRead(8);

Serial.print("RST");

Serial.println(value, DEC);

delay(3000);

}

Experimental serial port return

insert image description here
Arduino experiment scene diagram

insert image description here

Guess you like

Origin blog.csdn.net/weixin_41659040/article/details/131271131
Recommended