Pages: [1]   Go Down
Author Topic: coding pots  (Read 360 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* IMG00062-20120311-1429.jpg (215.63 KB, 1072x804 - viewed 5 times.)
* sketch_NesArduino.pde (5.5 KB - downloaded 5 times.)
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arrays! Arrays! Arrays! Your code needs arrays.

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

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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:
Code:
int potVal = analogRead(potPin);

Using the value is up to you.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17261
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Pages: [1]   Go Up
Jump to: