1

I am new to Arduino I got 0 knowledge in it and also this is my first time coding with bluetooth, so I wanted to ask how can I actually receive serial data from arduino for example and change the textview in my android:

this

I want to get this value from arduino and change the textview in my android. So it will be something like if (xxx == "11"){ textview.setBackgroundColor(Color.RED);} but I don't know how to write/how to get the arduino value and declare in android.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Anonymous
  • 74
  • 2
  • 10
  • Check this : https://stackoverflow.com/questions/54599490/how-to-simply-pass-a-string-from-android-studio-kotlin-to-arduino-serial-bluet/54950438#54950438 – Wise Man Nov 23 '19 at 15:49

1 Answers1

1

You'll need a HC-05 bluetooth module for example, and the use of the Serial library. Try to define a new serial port and then send your data by it. Arduino code :

SoftwareSerial btSerial (12, 13); //TX sur 12 et RX sur 13
btSerial.begin(9600);
btSerial.println("Link Started !");
Wise Man
  • 169
  • 2
  • 12