so i am reading in a array of 4 variables, the first and last are constant variables to be tested and the 2nd and 3rd are to be used in a motor function., my test function is not working and, the setmotor is somehow changing the constant variables
i've treid that, it didn't change anything every array is still succesful,
i think one of my issue may be that im not buffering the serial read data properly, but i dont know how to do that, this is the first time ive used bluetooth to send data
so i'm sending the array of 4 bytes via bluetooth, the 1st and last are are constant and middle are the important values as they will be driving the motor,
im trying to test that the array is correct by checking the the first and last values incase for some reason the array comes through incorrect nothing happens, the bool function is letting any array through, i don't know whats missing from the function or if its a problem with calling it in the loop.
could of just told me save me a few hours, but thanks, i've been struggling with that for the worse part of 7 hours
You could have posted all your code.
For all I could have known, "test" could have been a boolean variable in scope in the first part of the incomplete code, and the "if (test)" could have been perfectly OK, both syntactically and semantically - you missed the opportunity presented by reply #1 entirely.
Your problem could have been elsewhere.