How to use app inventor and arduino

Hi, all,.
I'm learning about App Inventor. I've googled references and tutorials, but I can't understand it. maybe in this forum I can learn better... in my code the numbers can be read on the label in the application, but the background color in the "call mode_setup" block does not change.
how to communicate between arduino and app inventor.
Thank you

void loop() {

  mode++;
  Serial.println(mode);
  bluetooth.print(mode);
  bluetooth.print("/");  //ascii 47
  delay(2000);
  if (mode > 3) {
    mode = 0;
  }
}



SourceconnectionAppInv.zip (3.7 KB)

So you confirm that you receive numbers 1-4 from arduino to your app?

Yes, app receive number from 1-4.

I don't use AppInv, but I expect:
You have now 3 conditions, even if one of them is setting background to green, 2 of them are always setting background to gray. So result is always gray.

Try to set only one condition in mode_setup, and check if it works for that number.

Common logic would be
if
then
elseif
then
elseif
then
else

...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.