I have been fiddling with my code for the last hour or so but i can't seem to get it working the way that I want to. I have been reading about the idea of arrays being fixed states, but to be honest I'm just burnt out from this little experiment and would really appreciate some help.
basically what I want to do is to take my three temperature sensor readings that i have declared and lump them into an array. from that point I want to be able to increment the value of each respective variable in the array, depending on what current channel the user has selected.
so if the user is on channel 0, and they press R, i want temperatureSensor1Reading to be incremented with the following block of code. Please ignore the incompleteness I know this is not the entire code, but this isolates my issue at the moment.
temperature_t is a typedef that i declared earlier. The program does not give me any errors but it does not do anything when i press R or F (increment or decrement). I've just highlighted the blocks of code that reflect my goals. Thanks for your help in advance!
temperature_t selectChannel = 0;
temperature_t temperatureSensor1Reading = 75;
temperature_t temperatureSensor2Reading = 75;
temperature_t temperatureSensor3Reading = 75;
temperature_t temperatureSensorReadings[3] = {temperatureSensor1Reading, temperatureSensor2Reading, temperatureSensor3Reading};
case 'R': //if user input is R
case 'r'://if user input is r
temperatureSensorReadings[selectChannel] ++;
break; //exits loop