Difficulty sending more than one variable from a Microchip microcontroller using BLE (HM-10) and MIT APP inventor

.....like you shouldn't have listened to us in the first place? :grin:

Hi Patrick

Could you try this Project
Swirlworks3B.aia (199.0 KB)

with this Script? Ugo (Usane) suggested going back to sprinf(). I think he could be on to something because we had some success before.
main3.txt (15.6 KB)

Edit: I have replaced Swirlworks3.aia with a revised project, Swirlworks3B.aia, removing a self-inflicted bug and improving status report.

Hello Chris...
Please see screenshot... I tried something similar by the way...

"B" version

Hello Chris
This statement is not correct.

Ugo = uskiara.
I am a different person.

Sorry Ugo, but I had to align the name with the forum name for it to make sense to anyone else.

Thanks Patrick - I hope I haven't made your hair go grey!

I think what is happening is that the Block's separation of values is not triggered because they are not accompanied by BLE characteristic data - so I guess we are lucky we can get data in.

Kidology:

main4.txt (15.2 KB)

EDIT: On second thoughts, this is not enough to work.

A final attempt using an array. Swirlworks3B.aia with this script:
main5.txt (15.3 KB) :crossed_fingers:

Hello Chris...
See attached... Thankful for screenshots as this would be difficult to describe with text only!

Ah well - thanks for trying! Looks like we cannot fool the extension Block, we must write data to it with BLE Characteristics. Still, at least it is possible to send a single string and split that into a csv List of the values.

Chris .. I am grateful for the help.
Can you look at another strange behavior with the MOD calculation?
Bluetooth not involved... pic not involved... use the slide bar to set a start time then press "start timer" watch it count down.
As the seconds count down, minutes -should- decrement when the seconds come to zero....however.... what happens is that the minutes decrement when the seconds drop below 30 !!!
is this an App inventor Bug?

demo_mod_error.aia (2.9 MB)

Most probably it is an error in your blocks

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun


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


sample run

At first sight, it looked fine to me.

I went back and reread your post, and now see that you fell victim to rounding in the format as decimal number block.

Try the quotient block instead, or the floor() block.

1 Like

ABG
I replaced "format as decimal number" with "floor" and it corrected the problem

Taifun
I would like to provide a picture of the blocks like others do on the forum... I am not sure how I can export them in such a way to place them on the forum. (like ABG did after your suggestion.)

Thanks to both of you for your insights.
Patrick

  • right click on "Cleanup Blocks" on an empty space on the Blocks Workspace
  • right click on Download Blocks as PNG on an empty space on the Blocks Workspace for all blocks, or
  • right click on individual blocks for Download Blocks as PNG for draggable blocks

http://ai2.appinventor.mit.edu/reference/other/download-pngs.html

Thank you...
I thought I would do the "Block download" to show the final result with the question regarding using the MODULO math function to make a down counter...
This works nicely

This Forum Topic, using BLE Characteristics, does send a compatible data list that is processed directly:

Thank you, Chris, I will look into it...
Patrick

1 Like