Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <SoftwareSerial.h>
  2.  
  3. SoftwareSerial hc06(2,3);
  4.  
  5. void setup(){
  6.   //Initialize Serial Monitor
  7.   Serial.begin(9600);
  8.   Serial.println("ENTER AT Commands:");
  9.   //Initialize Bluetooth Serial Port
  10.   hc06.begin(9600);
  11. }
  12.  
  13. void loop(){
  14.   //Write data from HC06 to Serial Monitor
  15.   if (hc06.available()){
  16.     Serial.write(hc06.read());
  17.   }
  18.  
  19.   //Write from Serial Monitor to HC06
  20.   if (Serial.available()){
  21.     hc06.write(Serial.read());
  22.   }  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement