coding pots

any one care to help me code some pots for my midi controller
sketch is added
just need 4 pots added to my sketch they are on analog inputs 0, 1, 2 and 3
there aint much to do, but im stuck
any help would be sweet

sketch_NesArduino.pde (5.5 KB)

Arrays! Arrays! Arrays! Your code needs arrays.

What do you need these pots to do? How are they wired? What have you tried?

these pots will be controlling effects parameters in ableton live, they are wired from 5v to ground and the signal pins goes to the analog inputs. what you mean by arrays? im a coding noob :slight_smile:

these pots will be controlling effects parameters in ableton live

No. What you mean is that you will use the value read from the pot to do something.

Reading the value from the pot is trivial:

int potVal = analogRead(potPin);

Using the value is up to you.

yea sorry, so should this wee code you have shown be in my loop function?

djbadja:
yea sorry, so should this wee code you have shown be in my loop function?

That depends if your applications sketch needs to continously read the pots and update something or if your application only requires a one time only value from the pots. You as the programmer have the ultimate power on how and when and how often you use the values read from the pot. Of course with that power comes responsiblity on knowing what you wish to perform in your sketch application.

Lefty