DIY sysex fader box status and questions.
ToAd
tom.adam at thebigear.be
Mon Apr 23 22:23:45 CEST 2012
Ok, a few basic questions:
I've got this for statement running 4 times (for each switchVar and
OLDswitchVar) in the void loop:
for (int k = 0; k <= 3; k++)
{
int j = (2*k)+1;
int i = j-1;
int a = bitRead(switchVar1, i);
int b = bitRead(switchVar1, j);
int OLDa = bitRead(OLDswitchVar1, i);
int OLDb = bitRead(OLDswitchVar1, j);
if ((a == 1) && (b == 1))
{ }
if ((a == 0) && (b == 0) && (OLDa == 0) && (OLDb == 1))
{ }
else
{
}
}
1) how do I make a function of this that I can call up in the void loop?
Something in the line of:
array calcpotrot(byte switchVar, byte OLDswitchVar) ---(what exactly do
I need to put between ()?)
and than change the for loop in void loop to
potrot1[3] = calcpotrot(switchVar1, OLDswitchVar1)
SHould I end this function with a return statement? Or is it somehow
defined in the syntax?
Next one, how does one do this:
oldvalue = value;
for an entire array with same length?
Last one, any idea what's wrong with this:
for (int n = 0; n <= 3; n++)
{
int c = OLDvalues1[n];
int d = encoders1[n];
values1[n] = c + d;
values1[n] = OLDvalues1[n];
}
I should get me a good book about the basics, i guess :-\
I hope you guys don't mind these posts, just let me know otherwise.
Cheers,
ToAd
On 21/04/2012 15:47, Jay Vaughan wrote:
>> Does this imply me to write 156 switch cases?
> No, only 8 - one for each pot, going in either up or down direction ..
>
> ;
> --
> Jay Vaughan
>
>
>
>
> _______________________________________________
> music-bar mailing list
> music-bar at lists.music-bar.org
> http://lists.music-bar.org/cgi-bin/mailman/listinfo/music-bar
More information about the music-bar
mailing list