Advertisement
pleasedontcode

Serial Bluetooth rev_05

Dec 10th, 2023
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: Serial Bluetooth
  13.     - Source Code compiled for: Arduino Nano
  14.     - Source Code created on: 2023-12-10 07:40:56
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* transmit the UUID of the HC05 */
  21. /****** END SYSTEM REQUIREMENTS *****/
  22.  
  23. /****** DEFINITION OF LIBRARIES *****/
  24. #include <Arduino.h>
  25. #include <SoftwareSerial.h>
  26.  
  27. /****** FUNCTION PROTOTYPES *****/
  28. void setup(void);
  29. void loop(void);
  30.  
  31. /***** DEFINITION OF Software Serial *****/
  32. const uint8_t HM10_HC05_mySerial_PIN_SERIAL_RX_A1 = A1;
  33. const uint8_t HM10_HC05_mySerial_PIN_SERIAL_TX_A0 = A0;
  34. SoftwareSerial HM10_HC05_mySerial(HM10_HC05_mySerial_PIN_SERIAL_RX_A1, HM10_HC05_mySerial_PIN_SERIAL_TX_A0);
  35.  
  36. /****** SYSTEM REQUIREMENTS *****/
  37. /*** SYSTEM REQUIREMENT 1: Transmit the UUID of the HC05 ***/
  38. const char* UUID = "A1B2C3D4E5F6";
  39.  
  40. void setup(void)
  41. {
  42.     // setup code here, runs once:
  43.     HM10_HC05_mySerial.begin(9600);
  44. }
  45.  
  46. void loop(void)
  47. {
  48.     // main code here, runs repeatedly:
  49.  
  50.     /*** SYSTEM REQUIREMENT 1 ***/
  51.     // Send the UUID of the HC05
  52.     HM10_HC05_mySerial.write(UUID);
  53.     delay(1000);
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement