document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <SoftwareSerial.h>
  2.  
  3.  
  4. const int rx = 0; //PA0 will be linked to the TXD pin
  5. const int tx = 1; //PA1 will be linked to RXD pin
  6. char c;
  7. int LED=8;
  8. SoftwareSerial mySerial(rx, tx);
  9.  
  10. void setup(){
  11. pinMode(LED,OUTPUT);
  12. mySerial.begin(9600);
  13. }
  14. void loop(){
  15. mySerial.print("ok"); //I would like to see "ok" written on my interface
  16. mySerial.println();
  17. delay(300);
  18.  
  19. if (mySerial.available()>0){
  20. c = mySerial.read();
  21. mySerial.print(c);
  22. if (c=='1'){ //LED blinks one time and switch on
  23. digitalWrite(LED,HIGH); //LED turns on
  24. delay(150);
  25. digitalWrite(LED,LOW); //LED turns off
  26. delay(300);
  27. }
  28. }
  29. }
');