Analog input from 10K slide potentiometer


I have my 10k slide potentiometer hooked up to my Arduino according to this guide:

And I am using attached code.

I am using JunXion to convert serial data to MIDI. And the only values I get from the analog input PIN0 is 0.00 to 1.98.

With this hooked up and everthing, I doesn’t get the correct functionality in ex. Traktor Pro. The fader only move a liiiiiittle bit.

What have I missed? :blush:
:slight_smile: Oskar

junXion_ArduinoMega.pde (14.5 KB)

Agreed. You are using a rather complex and unusual method of addressing the analog input pins for your analogRead() statement. Have you tested this to see that it is actually reading the pin you think it is? Perhaps a diagnostic print statement just before the analogRead() statement can verify that you are addressing the analog pin used to read your pot.


Hm... It does WORK I guess. But I only get those values... Don't know why...

But I have connected 1 & 3 on the pot to GND and 5V, and 2 to Analog PIN0.

And I have stated that I want to use A0 in the code as attached.

Everything seems fine(?)... But I get those low values...

I'm a noob. Sorry.

Wiho! It worked =) I got values from 0 to 1023 =)

Now I’m ready for the next step :fearful: :blush:

The code is attached in the first post! I attach it here again!

Thanks for your help and time! :slight_smile:

junXion_ArduinoMega.pde (14.5 KB)


...the code is supposed to work with JunXion. And is made by the guys who make JunXion...! They are very good!

I'm not this kind of code junkie... Don't know what to do! :astonished:

I just glanced at our code... As I only have a vague Idea of what it does, its sort of hard for me to debug it... I am no "cody junky" either, but the way I would go about it is sort of "prune it"

I am sure that 95% of the code is not necesary for reading one poti. Delete all parts of the code you dont need for this to work, until you have only the bare bones parts which are absolutely necesary. If you dont understand the code - do it by trial and error if necesary. At the end, you should have a much shorter simpler code, that you actually understand and can debug yourself.

or you have a shorter simpler code that someone here can help you with.

Dont know if my advice helps. But thats the way I started working with arduino&processing and it got me quite far.

good luck


Oh! I got a great reply from Support @ Steim! They are really nice and kind!

the lines containing the definition of the analog inputs look like this:

int input33[3] = {'a', 0, 16}; // analog input {'a', x, 8} pin x is variable between 0 and 5
int input34[3] = {'a', 1, 16};

change into:

int input33[3] = {'a', 0, 10}; // analog input {'a', x, 8} pin x is variable between 0 and 5
int input34[3] = {'a', 1, 10};

so, the number 16 has to be changed into 10. Right now junXIon assumes this is a 16-bit resoliution sensor while in reality it is a 10 bit number.

In junXion it will be shown to you in your 'user defined' data range, which by default is 0 - 127

Problem solved :slight_smile:

Thanks everyone for your time!