mc_workshop

DID comandi AT

May 16th, 2021
454
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.   Bluetooth HC05 Comandi AT
  3.   July 2020 by MC Workshop.
  4.   This example code is in the public domain.
  5.  --- premere il pulsante sull'HC05, dare alimentazione, rilasciare ---
  6.  PIN 6 e 7
  7. */
  8.  
  9. #include <SoftwareSerial.h>
  10. SoftwareSerial BTserial(6, 7);
  11. #define __BAUD (38400)
  12. void setup()
  13. {
  14.   Serial.begin(__BAUD);
  15.   BTserial.begin(__BAUD);
  16.   delay(1000);
  17.   Serial.println("Pronto:");
  18. }
  19. void loop()
  20. {
  21.   if (BTserial.available())
  22.     Serial.write(BTserial.read());
  23.   if (Serial.available())
  24.     BTserial.write(Serial.read());
  25. }
RAW Paste Data