App crashes at startup A11

Good time, i have trouble with app. I think the problem with "Global Mode" and selecton, thst they may be like a text

Looks like your problem is global power ? Which is set to the component block of Switch 1 ?

I made some changes, is it right now?

Does it work? Looks like it should send "10" now.

If this arrives at your bluetooth device as a string (and it needs to be an integer), then multiply the join of power and mode by 1 using a maths block.

No, it isn't working, I don't why I can't start the app on Android

Yeah, this is what I want, I want combinations like: "00", "10", "01", "11"

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Hi

Snap2

What is the receiving device, a microcontroller (e.g. Arduino)?

What is the Bluetooth version of the receiving device?

There is no safety net in your code. You do not switch on Location.

Here is a template Project that you can modify or copy from:
BT_Basic_Setup_Send.aia (7.2 KB)

If you are sending to a microcontroller, post your script/Sketch here.

Yes it is arduino))) with HC-06

OK, so Classic BT. Post your Sketch file here (.ino)

int val;
int led = 6; //ะฟะพั€ั‚
void setup() {

Serial.begin(9600);
pinMode(led, OUTPUT);
digitalWrite(led, HIGH);
}

void loop() {

if (Serial.available())
{
val = Serial.read();
if (val == '1')
{
digitalWrite(led, HIGH);
}
if (val == '0')
{
digitalWrite(led, LOW);
}
}
}

Sooo, your Sketch is not expecting a string nor the number 10. It also has no control of the Loop time interval......

Here is an example Sketch that you can adapt. It expects to receive numbers defined as characters, which is what your App is currently sending.

BetterLoop.ino (1.1 KB)

Okay, but you misunderstand me, the main problem is the thing that I can't run app on my phone. I don't have any troubles with sketch, that one I sent to you was just example

That is not what the title of your Topic suggests.

How would you know if you can't run the App? I know from experience that your Sketch is not right, which is why I offered my help with an example. If you don't want to be helped, you are going the right way about it........

Right - we need to know in detail what you see - is the issue during installation of the APK or when you run the App - tell us what happens exactly and what error message you get (if any).

I am sorry I really love your help



Here it is. It is installs correctly and have all permissions

Bluetooth is on, Location is on?


I gave all permissions i could, it is Bluetooth and Storage, but there is no Location