File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed
Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,13 @@ Connect with bluetooth in Unity (Android).
99- Send/Write Message
1010
1111## Demo
12- <img src =" https://i.imgur.com/SiCdH6U.png " style =" max-height : 400px " />
13- <img src =" https://i.imgur.com/efwZzib.png " style =" max-height : 400px " />
14- <img src =" https://i.imgur.com/Tw0lsmE.png " style =" " />
12+ <img src =" https://i.imgur.com/SiCdH6U.png " height =" 400 " /> <img src =" https://i.imgur.com/efwZzib.png " height =" 400 " /> <img src =" https://i.imgur.com/Tw0lsmE.png " height =" 400 " />
1513
1614
1715## Notes
1816
1917### AndroidManifest Permission
20- These are permissions required!! You ** MUST** add them to your ` AndroidManifest.xml ` manifest .
18+ These permissions are required!! You ** MUST** add them to your manifest ( ` Plugins/Android/ AndroidManifest.xml` ) .
2119
2220``` xml
2321 <!-- Bluetooth -->
@@ -30,7 +28,7 @@ These are permissions required!! You **MUST** add them to your `AndroidManifest.
3028
3129After you install the app, you may need to manually enable the permissions under android application settings.
3230
33- <img src =" https://i.imgur.com/33vq1ev.png " style = " max-height : 400 px " />
31+ <img src =" https://i.imgur.com/33vq1ev.png " height = " 400 " />
3432
3533
3634## Project Stucture
Original file line number Diff line number Diff line change 1+ ## UnityBluetooth Arduino
2+
3+ Tested on ESP32 and Arduino UNO + HC-06
4+
5+ On top of the code, Uncomment the define statement of the device you wanna use.
Original file line number Diff line number Diff line change 1- #define USE_HC0506 true // if use HC-05/HC-06, uncomment this
2- // #define USE_ESP32 true // if use esp32, uncomment this
1+ #define USE_HC0506 true // if using HC-05/HC-06, uncomment this
2+ // #define USE_ESP32 true // if using esp32, uncomment this
33
4+ /* -------------------------------------------------------------------------- */
45
56#if USE_HC0506
67#include < SoftwareSerial.h> // HC-05/ HC-06
@@ -40,8 +41,6 @@ void loop() {
4041
4142 // Get message from blutetooth, and print in serial
4243 if (bluetooth.available ()) {
43- // String msg = bluetooth.readString();
44- // Serial.println("[From Bluetooth] " + msg);
4544 String s = bluetooth.readString ();
4645 Serial.print (" BLUETOOTH GET << " + s);
4746 }
You can’t perform that action at this time.
0 commit comments