Hello. I am creating a program to remotely control an arduino relay. I use BLE extension. I have everything working now, but I want to improve something. The question is how to compare the received data (String) with the known string.
My arduino sends the string: "a11". This is implemented as follows:
Serial.print("a11");
In the Android program, I received it and display it on the screen:
In my program it looks like this:
But I want to compare the received String with the one known in the program and display the inscription ON or OFF instead. I tried to do it somehow like this, but it didn't work for me.
It's slightly worse than that. The default formatting of a list depends on the ShowListsAsJson property of Screen1. In newer projects, this is true by default. Older projects (or projects where it is unchecked) will default to the Scheme notation for lists using parentheses.
Generally, you can grab the first item in the list and use that value to compare to your intended target.