/********* 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: RS485 Communication
	- Source Code NOT compiled for: ESP32 DevKit V1
	- Source Code created on: 2024-05-17 07:38:52

********* Pleasedontcode.com **********/

/****** SYSTEM REQUIREMENTS *****/
/****** SYSTEM REQUIREMENT 1 *****/
	/* 1. Implement RS485 communication protocol using */
	/* Hardware Serial with baud rate 9600bps for data */
	/* transmission. */
/****** SYSTEM REQUIREMENT 2 *****/
	/* Implement RS485 communication protocol using */
	/* Hardware Serial with baud rate 9600bps for data */
	/* transmission on Serial2.  I want to transmit */
	/* number 1 into decimal address 1822 via RS485. */
/****** END SYSTEM REQUIREMENTS *****/

/****** DEFINITION OF LIBRARIES *****/
#include <HardwareSerial.h>

/****** FUNCTION PROTOTYPES *****/
void setup(void);
void loop(void);

/***** DEFINITION OF Hardware Serial *****/
HardwareSerial RS485(2); // TX_PIN: D17, RX_PIN: D16

void setup(void)
{
	// put your setup code here, to run once:

	Serial2.begin(9600); // Initialize Serial2 for RS485 communication
	RS485.begin(9600); // Initialize RS485 communication

}

void loop(void)
{
	// put your main code here, to run repeatedly:

	// Transmitting number 1 to decimal address 1822 via RS485
	RS485.write(1);

	delay(1000); // Delay for 1 second

}

/* END CODE */