Micro:bit received Number from app inventor

Hi,
Im working on app inventor to creat an application connect to BBC Micro bit, and it connects well. But id like to send number value to microbit which i dont know how does it work. I can send texts using uart microbit extension, But i cant use number value, any help would be appreciated.

1 Like

In make code on the microbit part, in the text section, use that “parse to number” block.
If you use uart, it is much easier to send strings.
Cheers, Ghica.

1 Like

Thank you Ghica. Thats great.

How about if i want the vers versa. Id like to send the value of Ultrasonic sensor to the app inventor?

1 Like

That is a tough question. I was never able to send anything from a microbit to ai using uart.
If you do, tell us how you did it!
In principle you should be able to use the convert … to text block on the microbit. Then at the AI side, conversion to a number is automatic, depending on how you use the text.
Cheers, Ghica.

1 Like

unfortunately, i coulndnt do it, if you know any one have done it plz reply to me
thank you Ghica

1 Like

Hi Essa,
My problem could have been the lck of memory on the Micro:bit. I needed to use the Maqueen extension and I think it had a few bugs apart from using more memory that needed. I tried to contact the company who made the robot car but I received no reply.
What you can do, is upload your .hex and your .aia files here, maybe there is someone who can take a look.
Cheers, Ghica.

1 Like

Thank you Ghica for your reply

Ok Ghica,
Now im working on app inventor which has slider to control a servo that connected to microbit.
Is there any help to edit my simple project to work properly.
Here is the app inventor
arm_robot.aia (354.4 KB)

Here is the simple code in makecode:

Could i use HC-06 bluetooth module instead of integrated microbit bluetooth.?

Essa,
No, you cannot use HC-06, how are you going to attach it to the micro:bit? And the micro:bit would need a whole lot of software that certainly would exceed its storage limits.

In your data received block on the micro:bit you read the data until a newline, but I am not sure you actually send one. I solved this by sending a “.” after my command and read in the micro:bit until “.” instead of new line.
Also, what is the serial write string (…) supposed to do? (I am not allowed to write the name of your button there, funny).
You should write a debugging app for the micro:bit with which you can experiment moving your robot arm, using some fixed values for example. Only then, when this works, you could try to connect to your AI app.
Cheers, Ghica.

Thank you Ghica,
i thought if i could use hc-06 bluetooth that could allow me to send number to microbit and thus using slider in app inventor to control servo.
Have a look here on this youtube vid which some using hc-06 bluetooth module with microbit.

Essa,
This YouTube is not very understandable to me.

It totally depends on your setup.
Where is your robot arm connected to? To a micro:bit or to an Arduino?
If it is the micro:bit, it would be strange to put an Arduino in between, try to get your robot arm working without App Inventor first, as I said in my previous post.
If the robot arm is already attached to an Arduino, why would you have a micro:bit?

Yes, communicating with an Arduino via a HC-06 may be easier, but the HC-06 is just a Bluetooth connection piece of hardware, you still have to problem of communicating to whatever the HC-06 is attached to.

thank you so much for ur reply

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.