5 Button D- Pad
€4.99 ex. VAT
This breadboard-compatible 5-button analog module provides navigation and input functionality with a single analog output pin. It works by assigning each button a unique resistance value, simplifying wiring and conserving GPIO pins. Fully compatible with Arduino and Axiometa platforms, it’s an ideal choice for compact projects requiring multi-button functionality.
SKU: AXM0016
Details
What's inside?
Discussion
Details
Overview
With all pads connected to a single analog output, it detects individual pad presses or combinations via unique resistance values. The mirrored pin design ensures easy connections, making it fully compatible with Arduino and Axiometa platforms for versatile prototyping.
- 5 Total Buttons
- Single Analog Output
- Arduino Compatible
- Genesis Matrix Compatible
Documentation
This part is fully open sourced with schematics and 3D files available bellow
AXM0016
Step by step user guide
All Axiometa products come with user guides and setting up instructions
Connection Guide
Here you’ll find connection guide images to help you integrate the sensor with various development platforms.
×
Arduino Example Code
If you haven’t already, check out this tutorial to guide you through setting up the Arduino IDE for uploading and debugging your sketches, as well as installing libraries.
For this part, you won’t need to use a library.
Code copied!
#define PORT A0
int debounce = 150;
void setup() {
Serial.begin(9600);
}
void loop() {
if (analogRead(PORT) > 1000) {
} else if (readAnalogButton() == 4) {
Serial.println("DOWN");
delay(debounce);
} else if (readAnalogButton() == 2) {
Serial.println("RIGHT");
delay(debounce);
} else if (readAnalogButton() == 5) {
Serial.println("LEFT");
delay(debounce);
} else if (readAnalogButton() == 1) {
Serial.println("CENTRE");
delay(debounce);
} else if (readAnalogButton() == 3) {
Serial.println("UP");
delay(debounce);
}
}
int readAnalogButton() {
int buttons = 5;
int resolution = 1023;
float avg = resolution / float(buttons);
int val = analogRead(PORT);
if (val > (buttons – 0.5) * avg) {
return 0;
}
for (int i = 0; i < buttons; i++) {
if (val < round((i + 0.5) * avg)) {
return i + 1;
}
}
return 0;
}
To see it working open serial monitor
MAC: CMD+Shift+M
Windows: CTRL+Shift+M
Related products
What's inside?
Discussion
Add a review
5 Button D- Pad
Rating*
0/5
* Rating is required
Your review
* Review is required
Name
* Name is required
Email
* Email is required
0.0
Based on 0 reviews
5 star | 0% | |
4 star | 0% | |
3 star | 0% | |
2 star | 0% | |
1 star | 0% |
0 of 0 reviews
Sorry, no reviews match your current selections