Error Compiling Blink sample

By declaring statepl inside setup() you make it local to setup() and thus you get the "not declared in this scope" error when you try to use it in loop(). You need to declare statepl in the global scope (outside of setup()) if you want to be able to use it in loop():

int statepl = 3;
// the setup function runs once when you press reset or power the board
void setup() {
  pinMode(statepl, FUNCTION_3);//rx pin!!!
  pinMode(statepl, OUTPUT);
}


// the loop function runs over and over again forever
void loop() {
  digitalWrite(statepl, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(statepl, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}