It actually says:
sketch_dec30d:23: error: expected unqualified-id before 'if'
sketch_dec30d:24: error: expected unqualified-id before 'else'
sketch_dec30d:25: error: expected unqualified-id before 'if'
sketch_dec30d:26: error: expected unqualified-id before 'else'
sketch_dec30d:27: error: expected unqualified-id before 'if'
sketch_dec30d:28: error: expected unqualified-id before 'else'
sketch_dec30d:30: error: expected unqualified-id before 'if'
sketch_dec30d:31: error: expected unqualified-id before 'if'
sketch_dec30d:32: error: expected unqualified-id before 'if'
sketch_dec30d:33: error: expected unqualified-id before 'if'
sketch_dec30d:34: error: expected unqualified-id before 'if'
sketch_dec30d:35: error: expected unqualified-id before 'if'
sketch_dec30d:36: error: expected unqualified-id before '{' token
First, move the squiggly bracket to the end:
void loop () {
analogWrite (RED, r); //set red pin to brightness value
analogWrite (GREEN, g); //set green pin to brightness value
analogWrite (BLUE, b); //set blue pin to brightness value
} // <------- this one, move to the end of the sketch
Next, C++ statements end with a semicolon, so change:
if (rt == 0) {r=r-1} //if trigger is set to dim, dim by 1
to:
if (rt == 0) {r=r-1;} //if trigger is set to dim, dim by 1
Next, use the auto-format tool and clean up the layout, it is hard to read like that. It should look more like:
if (rt == 0)
{
r = r - 1; //if trigger is set to dim, dim by 1
}
There's no reason to avoid hitting the space bar or <return> key. Try to make the code nice and readable.