Ok I understand. My next question would be, how would I go about writing the the saved values when powering on the arduino after its been off? Or is how I have it correct besides the changes to be made in the buffer?
Speaking of buffer, here's something I was working on throughout most the nite before finally getting the bugs out earlier today. I added another case to my program to simply turn on/off the red led in my RGB. I was able to turn it on on first attempt with no problem, however it would only turn off on the 4th button press. (I have the button setup as a toggle switch)
ex. Press button- red light turns on
Press button 2nd time to turn off- nothing
Press button 3rd time- light is already on so no change obviously
Press button 4th time- finally it turns off
I tried every combination of Serial.read(), Serial.flush(), Serial.peek() and any other combo that mite work within the case and nothing. Finally instead of having of the app send only 1byte(3) to turn the light off, I changed it to send 3bytes(9,3,9) and FINALLY it worked properly lol. I believe it was an issue with the buffer, but I cannot understand what exactly. Here's the code..
Sending the 'R' - no problems there. Sending only 1byte(3) gave me the headache I just explained. Sending (9,3,9) and it works perfect, which Im glad, but Im not sure why though. If you have any idea, I'd really like to know, this thing was driving me crazy lol