#include <SoftwareSerial.h>
const int rx = 0; //PA0 will be linked to the TXD pin
const int tx = 1; //PA1 will be linked to RXD pin
char c;
int LED=8;
SoftwareSerial mySerial(rx, tx);
void setup(){
pinMode(LED,OUTPUT);
mySerial.begin(9600);
}
void loop(){
mySerial.print("ok"); //I would like to see "ok" written on my interface
mySerial.println();
delay(300);
if (mySerial.available()>0){
c = mySerial.read();
mySerial.print(c);
if (c=='1'){ //LED blinks one time and switch on
digitalWrite(LED,HIGH); //LED turns on
delay(150);
digitalWrite(LED,LOW); //LED turns off
delay(300);
}
}
}