Skip to product information
1 of 3

Axiometa

Button D-Pad

Button D-Pad

SKU:AX22-0016

Regular price $3.10
Regular price Sale price $3.10
Sale Sold out
Taxes included. Shipping calculated at checkout.
Bring classic game-console navigation to any project with this AX22-sized board. Five low-profile ALPS Alpine SKRPADE010 tactile switches are arranged in a “plus” pattern Up, Down, Left, Right, and Center, and tied to a  resistor ladder so all five directions share a single ADC pin. Pressing a direction pulls the ladder to a unique voltage, letting your code identify which button is down with one quick analog read. Snap it into any AX22 backplane to add intuitive D-Pad control to menus, games, robots, or data-entry gizmos without burning five GPIOs.
View full details
  • Technical Details

    - 22 mm × 22 mm square
    - 4× ⌀2.7 mm Mounting Holes
    - Distinct voltage for each direction & center press
    - 1.8 V, 3.3 V, 5.0 V
    - Arduino IDE Compatible
    - MicroPython Compatible
    - MicroBlocks Compatible

    Material Datasheet 
  • Pinout

  • Interface

  • Top

  • Bottom

Arduino Example Code

example.ino
#define PORT 8

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;
}
        
  • First time setup

    Pair text with an image to focus on your chosen product, collection, or blog post. Add details on availability, style, or even provide a review.

  • Automatic Street Lights

    Pair text with an image to focus on your chosen product, collection, or blog post. Add details on availability, style, or even provide a review.

  • How Does an LDR work ?

    Pair text with an image to focus on your chosen product, collection, or blog post. Add details on availability, style, or even provide a review.