Advertisement
pleasedontcode

Serial Updates rev_01

Dec 31st, 2023
108
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 Updates
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2023-12-31 09:45:43
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* New firmware should be updated through OTA using */
  21.     /* Bluetooth */
  22. /****** END SYSTEM REQUIREMENTS *****/
  23.  
  24. /****** DEFINITION OF LIBRARIES *****/
  25. #include <Arduino.h>
  26. #include <SoftwareSerial.h>
  27.  
  28. /****** SYSTEM REQUIREMENTS *****/
  29. /****** SYSTEM REQUIREMENT 1 *****/
  30. /* New firmware should be updated through OTA using */
  31. /* Bluetooth */
  32.  
  33. /****** FUNCTION PROTOTYPES *****/
  34. void setup(void);
  35. void loop(void);
  36.  
  37. /***** DEFINITION OF Software Serial *****/
  38. const uint8_t OTA_HC05_mySerial_PIN_SERIAL_TX_A0 = A0;
  39. const uint8_t OTA_HC05_mySerial_PIN_SERIAL_RX_A1 = A1;
  40. SoftwareSerial OTA_HC05_mySerial(OTA_HC05_mySerial_PIN_SERIAL_RX_A1, OTA_HC05_mySerial_PIN_SERIAL_TX_A0);
  41.  
  42. void setup(void)
  43. {
  44.     // put your setup code here, to run once:
  45.     OTA_HC05_mySerial.begin(9600);
  46.  
  47.     /****** BEGIN OTA ******/
  48.     // Add code here to initialize OTA for Arduino Uno
  49.     /****** END OTA ******/
  50. }
  51.  
  52. void loop(void)
  53. {
  54.     // put your main code here, to run repeatedly:
  55.     OTA_HC05_mySerial.listen();
  56.  
  57.     /****** HANDLE OTA ******/
  58.     // Add code here to handle OTA updates for Arduino Uno
  59.  
  60.     // Your other loop code here
  61.    
  62.     // System requirement 1: New firmware update through OTA using Bluetooth
  63.     // Add code here to handle new firmware updates through Bluetooth
  64.    
  65. }
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement