Dual unit potentiometer not working propertly on Pro Micro

I'm making ebrake for sim racing and i have installed 10k dual unit potentiometer, but it work only in a half range, I think it might be something wrong with the code

// Analog eBrake-Handbrake
// PIN A0 to 10k pot output - Throttle Axis
// Use with Arduino ProMicro.
// Tested and working in DiRT RALLY + ASSETTO CORSA
// by AMSTUDIO
// 20.1.2017

#include <Joystick.h>

void setup()

{pinMode(A0, INPUT); 
   Joystick.begin();}

const int pinToButtonMap = A0;

void loop()

{int pot = analogRead(A0);
int mapped = map(pot,0,1023, 0, 255);
{Joystick.setThrottle(mapped);}}```

Why a dual pot? Does it have concentric shafts? How do you have it wired? Schematic, please, showing all the pot connections.
What values are you getting from the analog read? What clue was there that the code was a problem?
Paul

I bought dual by accident but I think it's possible to get it working,
Here is how I connected it Przechwytywanie
I making this Ebrake from this video on youtube HOW TO MAKE A USB ANALOG HANDBRAKE | SIM RACING DIY EBRAKE - YouTube

What makes you think you're only getting "half range"? Why don't you put some serial prints in and find out.

If there's a problem with the code it's probably in the "}```" part.

Steve

Here is video showing the problem video

I'm new to arduino and I have no clue about this stuff

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