Hi,
I have problem on assegnation function variable return value "choice" to other variablebut "BAND_ID" .
On monitor i have correct variation of "choice" value but "BAND_ID" is always 0 (zero)
Some solution? Thank you
/*************************
** Custom Variable **
*************************/
char choice=0;
char BAND_ID=0;
void loop(){
BandChangeButton();
BAND_ID=choice ; //BAND_ID=BandChangeButton();
Serial.println (BAND_ID,DEC);
Serial.print (" : ");
Serial.println (choice,DEC);
}
char BandChangeButton(void){
BandStateButton = button_number;
if(BandStateButton!=BandLastStateButton){
//delay(15);
BandCountButton++;
switch (BandCountButton)
{
case 1:
scelta=0;
Serial.println ("I'm here 1");
break;
case 2:
choice=1;
Serial.println ("I'm here 2");
break;
case 3:
choice=2;
break;
case 4:
choice=3;
break;
case 5:
choice=4;
break;
case 6:
choice=5;
break;
case 7:
choice=6;
break;
case 8:
choice=7;
break;
case 9:
choice=8;
Serial.println ("I'm here 9");
BandCountButton = 0;
break;
}
button_number=0;
} //end if
return choice;
}// BandChangeButton