Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* Pleasedontcode.com **********
- Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- - Terms and Conditions:
- You have a non-exclusive, revocable, worldwide, royalty-free license
- for personal and commercial use. Attribution is optional; modifications
- are allowed, but you're responsible for code maintenance. We're not
- liable for any loss or damage. For full terms,
- please visit pleasedontcode.com/termsandconditions.
- - Project: Bluetooth Data
- - Source Code NOT compiled for: Arduino Mega
- - Source Code created on: 2025-07-11 21:05:10
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* send data from bluetooth to android pc */
- /****** END SYSTEM REQUIREMENTS *****/
- /* START CODE */
- /****** DEFINITION OF LIBRARIES *****/
- #include <SoftwareSerial.h>
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- float T_interpolate(byte DS_Temp); // Added function prototype for T_interpolate
- /***** DEFINITION OF Software Serial *****/
- const uint8_t hc05_HC05_mySerial_PIN_SERIAL_TX_A0 = A0;
- const uint8_t hc05_HC05_mySerial_PIN_SERIAL_RX_A1 = A1;
- SoftwareSerial hc05_HC05_mySerial(hc05_HC05_mySerial_PIN_SERIAL_RX_A1, hc05_HC05_mySerial_PIN_SERIAL_TX_A0);
- void setup(void)
- {
- // put your setup code here, to run once:
- hc05_HC05_mySerial.begin(9600);
- }
- void loop(void)
- {
- // Check if data is available from Bluetooth
- if (hc05_HC05_mySerial.available())
- {
- // Read data from Bluetooth
- String receivedData = "";
- while (hc05_HC05_mySerial.available())
- {
- char c = hc05_HC05_mySerial.read();
- receivedData += c;
- }
- // Send the received data to the Android PC via Serial
- Serial.println(receivedData);
- }
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment