Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // https://retroetgeek.com/arduino/configuration-du-module-hc-05-pour-arduino/
- // https://www.aranacorp.com/fr/votre-arduino-communique-avec-le-module-hc-05/
- #include <SoftwareSerial.h>
- // Mapping Arduino Digital ports to Bluetooth Serial
- //#define rxPin 5
- //#define txPin 4
- #define rxPin A4
- #define txPin A5
- #define atmodePin 9
- #define baudrate 38400
- SoftwareSerial hc05(rxPin, txPin);
- void setup() {
- // passage en mode AT
- pinMode(atmodePin, OUTPUT);
- digitalWrite(atmodePin, HIGH);
- Serial.begin(9600);
- Serial.println("ENTER AT Commands:");
- hc05.begin(baudrate);
- }
- void loop() {
- if (hc05.available())
- Serial.write(hc05.read());
- if (Serial.available())
- hc05.write(Serial.read());
- }
Advertisement
Add Comment
Please, Sign In to add comment