Help Needed, Issues with Micro using Joystick Library

So been doing some research and finally got my joystick converted into a usb device. Most of it seems to be working but for some reason the analog data that comes in is so messy.

I recently acquired a CH Mach 3 joystick it uses 3 buttons and 2 potentiometers. Followed the tuts on how to set it up and well worked once "ish" and now its just all over the place. Buttons work fine. No idea what im supposed to do now.

This is the code im using: Arduino Cloud

Board: Using a Pro Micro clone 5V.
Potentiometers: HP-130A 137/871 1 ROC (tried to google this part but found nothing)

schematics please?

uh how do i make a schematic?

With a pen and paper. Take a picture with your phone or webcam. Or, if you built it from someone else's schematic, re-post that.

Also, it is customary to read the forum instructions, and follow the advice about how to post code.


hopefully this helps

The pushbutton switches are wired incorrectly. They will have undefined "floating" inputs when they are open. I hope the "tuts" didn't do it this way..

You need internal or external resistors with the switches. The easiest way, is to enable the internal pull up resistors using the INPUT_PULLUP option, connect the other end of the switches to ground instead of 5V, and invert the logic in the program to look for a LOW state with an active switch.

Look at the DigitalInputPullup example that ships with the Arduino IDE.

weird tho, ive never had issues with the buttons. it works fine. just having issues with the potentiometers

Actually, that circuit is so wrong, that it's weird if it does work... you haven't posted your code yet.

Regarding the joysticks, did you scope them out with a multimeter? You should post some images of the joysticks and all your wiring.

You haven't told us as much as you believe you have...

I have posted the code check again.

You haven't read the forum instructions. You need to post the code in line, inside a post, and using the code tags to format it.

Also, you left questions unanswered.

...and, according to the code that I found by following the link anyway, your switch wiring now needs to be modified, as explained in reply #6.

Another thing, we don't really have a description of the problem, other than "the data is messy" or "issues". Can you provide a more specific description of the potentiometer behaviour? Also, did your changes to the code change the pot behaviour?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.