like this?
Was there some part of "Modify your original post" that you failed to comprehend?
if (Serial.available() >0) {
// read the incoming byte:
inByte = Serial.read();
// If the marker's found, next 6 characters are the colour
if (inByte == '#') {
while (pointer < 6) { // accumulate 6 chars
buffer[pointer] = Serial.read(); // store in the buffer
So, if there is one byte available to read, read all 7 of them. Yeah? How's that working for you?
but i am having problems with the button to turn the lamp on and off.
You need to elaborate on this statement. What problem(s) are you having? Is it with Processing or Arduino?