In your blocks you wait for the BluetoothScan permission to be granted, but not for the BluetootConnect permission. I think you should add that.
And, do you REALLY send the println() from your Arduino?
And, did you really set the delimeter byte to 10 in the design?
And, what is the timer interval of the Clock?
???
Choose a reasonable timer interval
10 is too fast... try 1000 and if this works, then try 500
Taifun
With the same blocks in clock timer?
PS.
Still nothing happens
yes, the same blocks in the Clock. But... did you add to check for BluetoothConnect ??
And pls. answer my other questions, because that could also cause that nothing happens.
Hi, I guess the problem was with BTSerial.print without ln... but now it only shows state 1 and door is open( Položaj vrata:otvorena), when I change the state(press microswitch it stays as 1 instead of zero. Should I play woth time duration(time interval, delay in arduino)?
Are you sure that you also send println when the switch is zero?
Yeah, I verified it
Yes
However you could remove the first if statement, because after connecting this always will be true
Taifun
What is in that textfield with a difficult name, that shows what you received when you just sent a 0? And how does it differ from when you just sent a one?
It basically changes text to "open" if '1' is sent and "closed" if '0' is sent.
I notice you are lacking the use of the block that tells you if BlueTooth is connected NOW, as opposed to that global variable that tells you that you were once connected in the past.
See my Clock Timer's outer if/then test?
I was questioning that when I disconnected from bt module it still showed connected, I will change that. Thanks!
Yes, I understand that. But my question was whether primljeni_podatak.text really shows changing text if you try the app. If yes, why do you think your app is not working?
If no, something must still be wrong at the Arduino side.
It changes to "open" and number 1 is shown as a received data.
... And what happens if you send 0 ???
nothing happens, number 1 remains and text label stays as it was one("closed").
Does that global variable buffer change after the sent data is changed. Should I put another global variable?
Yes, the buffer should change if you send new data from the Arduino.
So, maybe you are not sending a println with the 0?
And no, no, no, you do not need more variables.
I am very positive I changed it to println😁