brunch

12.아두이노에 블루투스 연결하기

​빨----주------노--초 연결법

by Master Seo

아두이노에 블루투스 연결하기



1. 블루투스 모듈(HC-06)연결 하기


VCC - GND --- TX-RX

전원-- 그라운드- 발신-수신

빨----주------노--초 연결법





빨 --- 주 ----- 노--- 초

VCC -그라운드-발신 - 수신




빨간 = 5V

주황 = GND


노란 = 2번

초록 = 3번 연결




#include <SoftwareSerial.h>

SoftwareSerial Bluetooth(3, 2); // HC-06(TXD), HC-06(RXD)

void setup()

{

// Open serial communications and wait for port to open:

Serial.begin(19200);

Serial.println("Ready..");

// set the data rate for the SoftwareSerial port

Bluetooth.begin(9600);

// Bluetooth.println("AT"); // Test Module

}

void loop() // run over and over

{

if (Bluetooth.available())

Serial.write(Bluetooth.read());

if (Serial.available())

Bluetooth.write(Serial.read());

}




스마트폰에서 연결

블루투스 모듈 (HC-06)

Screenshot_20200226-204113_Settings.jpg



https://brunch.co.kr/@topasvga/2022




감사합니다.

keyword
매거진의 이전글13.스마트폰으로 아두이노 LED ON/OFF 제어