QB100 4-Button Module

1.Product Introduction

../../_images/4-Button-1.png

The 4-button module contains four presses, and the circuit is on when a button is pressed and disconnected when it is released. Because the four key switches share one analog output, they can only be connected to the analog port. Each key corresponds to an analog value, so as to realize the discrimination of different keys.

Application reference: remote control, keyboard, game controller, etc.

2.Parameter Specification

Parameter Value//Description
Operating voltage 3.3V~5V
Operating temperature -40°C~+80°C
Output signal Analog signal
Size 4.7cm*2.4cm
../../_images/4-Button-2.png

3.Wiring Diagram

Hint

Expansion board is attached to esp32 controller board.

../../_images/4-Button-3.png
4-Button Module ESP32
S 32
VCC 5V
GND GND

4.Sample Code

 1int n = 0;
 2
 3void setup(){
 4  Serial.begin(115200);//Set baud rate
 5}
 6
 7void loop(){
 8  n = analogRead(32);//Define the analog pin for the 4-Button
 9  //Print different button values
10  if(n<10){
11    Serial.println("Right: "+String(n));
12    }
13  else if(n>10 && n<=1000){
14    Serial.println("Down: "+String(n));
15    }
16  else if(n>1000 && n<=3000){
17    Serial.println("Left: "+String(n));
18    }
19  else if(n>3000 && n<=4000){
20    Serial.println("Up: "+String(n));
21    }
22  delay(300);
23}

5.Test Result

When you successfully connect the line according to the wiring diagram and successfully upload the correct program, when a certain button is pressed, the serial port monitor will print the corresponding button value.

../../_images/4-Button-4.png
../../_images/4-Button-5.png

6.Related Resources

PDF and Code

7.Get One Now

B2B Business: info@acebott.com

Related posts

Leave the first comment

Apply for a Free Trial

This product trial is prioritized for educators and academic institutions.

By filling out and submitting this form, you agree to the
Acebott Product Trial Terms and Conditions.

Unlock Your Exclusive Education Discount Today

Fill out this form to apply for special discounts tailored for educators and institutions. Enjoy at least 5% off on our STEM kits—because education deserves a reward!

Please fill out the form above, and our team will get in touch with you promptly!
😊🚀

Get A Free Quote! 🎉

Can’t find the perfect STEM kit ? Want the best wholesale prices ?
Interested in becoming a distributor ?

Just fill out the form above, and we’ll get back to you ASAP with all the info you need! 😊🚀

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.