Hi! I've built a custom arduino controller with some potentiometers that I got working with the gamepad object in construct. So I have 4 potentiometers controlling the left and right X and Y axis. However, when I turn the potentiometers I get an input range of -100 to -99.9992370605. I'ts the same on all 4 knobs. When used the way it is now, I'm having a hard time controlling my game project at all. Turning the knobs doesnt affect anything at all, even though I checked that the code works with a debug variable.
I'm really not that good at maths, but I believe there is some way I can add some maths to my code to make the range be 0 to 100 or something like that?
The problem might be that your custom controller isn't compatible. I had this same problem with a nintendo switch controller. It just kept inputting left in the game.
Develop games in your browser. Powerful, performant & highly capable.
For arduino, look into the map() function, it maps a range, over a given range
From the top of my head it will be something like:
NewKnobValue = map(KnobAnalogueValue, -100, -99.9992370605, 0, 100);
That will make your -100 to -99.9992370605 return its equavalent of between 0 to 100. (-100 being zero and 100 being -99.9992370605)
Thus, you can use decent numbers for Construct :)