If you are using Software Serial in addition to the board's, you need to identify the digital pins used and apply a name. You have used the name miBT which is fine, but if using an Arduino UNO for example, the Software Serial cannot use pins 0,1 - connect your Bluetooth Module to other pins and declare those in the Sketch -This is dependent on both the Arduino you have and the exact Software Serial Library, of which there are a few.
You still have not told us exactly what Arduino (and what chip, what board revision), what Bluetooth module and make/model of your Android Device you are using.
Hi ChrisWard. I'm using pin 10 and pin 11 (to be Rx and Tx) instead of 0 and 1.
I'm using a copy of Arduino UNO Rev3 (the actual name is Elegoo UNO R3) using a ATmega328P, a HC-05 and a Samsung Galaxy A52.
Sorry, I didn't read the request previously
Hi @Noobie,
the HW seems OK.
I would suggest also to remove the voltage adapter and to put two simple resistors (I don't know if the voltage converter has the ground properly connected or if it smoothes the edges of the serial line).
So please follow my hints. Be sure the pins are crossed (take a sight to the drawing) and initialize the library.
Before the setup instantiate the pins assignment
SoftwareSerial miBT(10, 11);
And in the setup the baudrate
void setup()
{
...
miBT.begin(38400);
...
...
Yeah, the code i wrote here is just a fast way to see if I'm connecting everything in right way, hardware side. I'll use the elapsed time method like you suggested before
Thank you so much to keep trying to resolve this topic. I'll let you know where this is going on
Before picking anything from the list of devices found I let the Clock_TimerConnect to run to actually find all devices. Is it right? I don't know because I don't understand anything about AI2.
if the bluetooth is connected the clock to get the data will run. How do I set the clock to run after picking the device I want? If I am right this clock will run regardless if im connected to the hc05 or not. But I dont know how do i change it.
What do I need to change here? The Connect address part?
when the clock for data run, if the bluetooth is connected i check if there are bytes >0 to receive. Here is the problem: Using a "else" statement I know that there is an error in the If block for bytes>0 because I get the error "Error in call BT>0".
Second: The arduino code. I cant get rid of this error (probably because im dumb)
Note that the serial.print is used just see if the sensors are working
If you know the exact way please write it down. I'm scarily running low on time, if I cant get it right I'll probably ditch this project.
Thanks for all the replies.
I can feel your stress Noobie - but you bring it on to yourself! You don't need to know much about programming but you do need to think with a clear head. Look at the name of that timer: Clock_Timer_Connect. It's for the Bluetooth Connection.
Now think - when are you going to be able to make a connection - before you have picked a device to connect or after you have picked it?
Hi Chris, that is a magnificent app, I couldn't do it to be honest. So...
Data not showing up. That's it. I turned on Location and the Bluetooth before everything else. I built the project, uploaded it, it scans, it connects, it doesn't show data. The serial monitor on my pc works extra fine.
In these days I asked some friends who work with apps, but they didn't give any answer.
I'm wondering if it is something hardware side and not software side What should I do? I really don't know what is the actual problem.
EDIT: This is what I see:
No, but we can first find out if anything at all is received by the App by temporarily dumping the DataRecieved into the Label_Msg. Change this block by adding the code outlined:
It's possible that there isn't enough power for the UNO. I found this with mine when powered from a PC USB. In fact, on any PC, not all USB ports have enough power to charge your fitness watch for example.
If you don't have a multi-meter to check, do you have an AC to DC Power Adaptor? 9v to 12V max DC output, at least 300mA to 1A max current output. It could have a 2.1mm diameter plug which is centre pin positive, or USB. Another alternative would be a battery pack.