Toggling a button in App Inventor

toggleApp Inventor is an easy piece of software  that starts you off in developing Android apps. If instead of two buttons to switch a state ON or OFF you want to have a button that toggles, the image shows how that is done.
Suppose I have a button called “bThuisToggle” it carries an image called “huis.png”. If I click it I want it to send a byte (85) and the next time I click it I want it to send another byte (117). I also want the image of the button to change into “huis_uit.png”.
The block in the picture shows clearly how to do that

Advertisements