Skip to content

feat: add analog joystick component (ADC0834 x/y axes + SW button) - #486

Open
sakshar2303 wants to merge 3 commits into
oss-slu:developfrom
sakshar2303:feature/joystick-component
Open

feat: add analog joystick component (ADC0834 x/y axes + SW button)#486
sakshar2303 wants to merge 3 commits into
oss-slu:developfrom
sakshar2303:feature/joystick-component

Conversation

@sakshar2303

Copy link
Copy Markdown
Contributor

Summary

Closes #370

What's Added

Helper Class

  • JoystickHelper.java — reads x-axis (ADC CH0), y-axis (ADC CH1)
    via ADC0834ConverterHelper; button press via DigitalInput (active LOW)
  • Methods: getXValue(), getYValue(), getDirection(),
    isButtonPressed(), addEventListener(), removeEventListener()
  • 9 direction outputs: UP, DOWN, LEFT, RIGHT, CENTER + 4 diagonals

Controller Class

  • JoystickController.java — endpoints: /joystick/x, /joystick/y,
    /joystick/direction, /joystick/isPressed

Configuration

  • application.ymljoystick-adc SPI block + joystick-sw
    digital-input block

Tests

  • JoystickHelperTest.java — 30 JUnit Jupiter tests covering all axis
    reads, all 9 directions, deadzone, button state, listener
    attach/detach and constants

Documentation

  • joystick.adoc — full AsciiDoc docs with assembly instructions,
    circuit and schematic diagrams, YAML config, API curl examples
    and troubleshooting guide

@sakshar2303 sakshar2303 mentioned this pull request Apr 11, 2026
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Joystick Support

1 participant