English
Español
PCBWAY PCB service

PCBWAY PCB service

PCBONLINE PCB service






Android app + Bluetooth + Arduino control


Code Blocks






Now we go in the right top corner and click the blocks button. A new viewer will open. On the left we can see all the blocks that we've added and the extra ones.

First we have to code the bluetooth client comunication. We want to open the bluetooth list every thime that the list picker that we've added is pressed and to connect to the selected bluetooth client when the list is closed. For that we select the list picker and drag the before picking block. Then we go another time to the list picker and drag the set list picker elements to block inside the before picking block. Finnaly we go to the bluetooth client and drag the adresses and names block.
Now we drag the after picking block from the list picker. We add the selection to block from the list picker. Finnaly we go again to the bluetooth client and drag the conect adresses block and after that we drag the list selection block from the list picker.

Now that our bluetooth connection block is done we have to edit what we will send when each of the buttn is pressed. For that we select first the button one. We drag the when click do block to our wiwer. After that we go to our bluetooth client and drag the send text block. Finnaly We go to the text blocks and drag a "" text block. I whant to send a "1" every thime that the button 1 is pressed.

We do the same for the other buttons. Just "CTRL+C" and "CTRL+V" the button 1 bloch and change the button and the text to send.

I whant to send an "a" when the button 3 is pressed and a "2" when the button 4 is pressed. In the case of button 2 I want to send an "9" just when the button is pressed and a "9" when is not pressed. For that we drag the button 2 touchDown and touchUp block and send a "8" and "9" in this case.

Our blocks are done. Now we ho to the top, we click build and save the app to our PC. Next we copy the ".apk" file to our smartphone using a USB connection and install it on our android smartphone.


Next page: