Arduino
작성자 임베디드코리아
작성일25-05-15 18:42
조회159회
댓글0건
<* UART를 이용한 체팅 *>
- 아두이노 2대를 이용하여 아두이노간에 체팅하기
---------------------------------------------------------------------------------------------------------------
#include <SoftwareSerial.h>
SoftwareSerial UARTserial(7, 8); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
Serial.println("SEOUL DIGITAL UNIVERSITY!");
// set the data rate for the SoftwareSerial port
UARTserial.begin(9600);
}
void loop() // run over and over
{
// Receive from bluetooth and send it to PC
if (UARTserial.available())
Serial.write(UARTserial.read());
if (Serial.available())
UARTserial.write(Serial.read());
}