fork download
  1. // * RX is digital pin 10 (connect to TX of other device)
  2. // * TX is digital pin 11 (connect to RX of other device)
  3. #include <SoftwareSerial.h>
  4. const int led = 13;
  5. const int btRX= 10;
  6. const int btTX= 11;
  7. SoftwareSerial bluetooth(btRX, btTX);//10-11
  8. void setup(){
  9. bluetooth.begin(38400);
  10. // velocitat de connexió que pot variar depenen de com es configuri
  11. pinMode(led,OUTPUT);
  12. digitalWrite(led, LOW);
  13. Serial.begin(9600);
  14. }
  15. void loop() {
  16. if (bluetooth.available()) {
  17. char dada = bluetooth.read();
  18. if (dada == '1'){
  19. digitalWrite(led, HIGH);
  20. Serial.println("1");
  21. }
  22. if (dada == '0'){
  23. digitalWrite(led, LOW);
  24. Serial.println("0");
  25. }
  26. }
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:3:28: fatal error: SoftwareSerial.h: No such file or directory
compilation terminated.
stdout
Standard output is empty