Advertisement
timor2542

[4 DOF Robot Arm Keyestudio][Lab 08][i-Duino UNO R3B] Bluetooth HC-06 Test on Serial Monitor

Aug 2nd, 2021
1,414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void setup()
  2. {
  3.   Serial.begin(9600);     // set the serial baud rate to 9600
  4. }
  5.  
  6. void loop()
  7. {
  8.   char val;    // define a variable, used to receive the value read from Bluetooth.
  9.   if(Serial.available())     // if receive the value
  10.   {
  11.     val = Serial.read();       // assign the value read to val
  12.     Serial.println(val);
  13.   }
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement