Как сохранить в TinyDB положение кнопок

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


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

первый блок устранения ошибок, второй блок это кнопка перехода на основной экран, третий блок авто подключение блютус, дальше блоки управления кнопок.


это экран управления, здесь включена одна кнопка, когда я нажимаю кнопку НАЗАД, и вхожу обратно, то все кнопки выключены

Place the same that you have in Initialize block also in "OtherScreenClosed" event block.

Anyway, this is not the correct way to switching screens.

search in the community. If you were in Screen1 and then open Screen2 and with that button you want to back to Screen1, then close screen2 (instead of open again screen1).

в том и дело что в приложении несколько экранов, задумка такова, что бы экраны сохраняли операцию кнопок.

The status of the variables a1, a2, a3...are stored in tinyDB. When you click each button, the values of those variables are stored in tinyDB (each variable under its own tag). When you restart the app, the first thing you are doing in Screen2 is to read those values from tinyDB. Then, if you need to do something based of those values, for example, set an image, you need to implement that logic based on those values.

So, if for example the value stored for a1=-1, when you back to the screen or when you reopen the app and go to this screen, after initializing the screen a1=-1. Now you need to implement the logic to set an image or whatever based on that value (maybe also in Initialize block, after read the values from TinyDB)...what you are storing in tinyDB is the value of the variables a1, a2....

у меня идея, а если сделать так, что бы при подключении ардуино по блютус, присылало отчёт, какое реле включено а какое выключено, и выводить значение

на кнопки присвоенного изображения, это реально сделать?

Рамон, я благодарю вас за огромную помощь в MIT APP, у меня вопрос, а вы знакомы с платформой ArduBlok?

No, sorry.
But if you have any question related to your app (AI2) integration with arduino/ESP, you can search in the community, there are a lot of topics related to it (or you can ask here in the community if don't find whatever you need, but remember that this is an appinventor community.).

Я благодарю вас за потраченное на меня вашего времени, и проведённый час с вами, я получил некие знания, которые в будущем мне помогут)))

1 Like