Arduino error in code
What you try here:

rp[8] = {0, 1, 1, 1, 1, 1, 1, 0};


is only valid in C++11. (Before that you can initialize an array like this only upon initialization.)

Besides, as pointed out by Pete Becker, you need to declare rp as an array rather than a single int.