Converting values in mit app inventor

How about sharing the input values and the formula, along with any constants?

sorry i dont get your meaning :sweat_smile:, do you have an example? sorry for my beginner knowledge and thanks for replying

for example, lets say i measured 30mV from my hardware connection consisting of arduino nano and bluetooth module, the bluetooth module will send the 30mV to my mit app inventor and displaying it. I want it to show the 30mV still and below it shows "glucose level= 90mg/dl ". How can i do the blocks editor by converting 30mV to 90mg/dl with a formula of "glucose level=voltage measured + 60" (for example)

whenever bluetooth module send the data to mit apps, the screen will always shown the data received and converting it lively.

Hello Raphael

The devil is in the detail - what Blocks you need depends on the exact format of the data received.

For example, if the data received is "30mV", you would need Blocks to remove "mV" before you could perform the calculation "30 + 60". On the other hand, since you are responsible for the Arduino Sketch, you can omit the unit symbol at the Arduino end and just send the data as "30", ready for the calculation as soon as it arrives.

So, how far have you got in connecting your App to your Arduino and receiving data?

do you know how to do the conversion of voltage to glucose level by inserting a formula? I have the formula dont worry, just need to know how to do it. Thanks

Since you have a formula , you can use the Math blocks ... Math blocks .

Exactly how you use the Math blocks to convert voltage to a value depends on the formula Raphael.

What is the formula? Maybe someone can provide a suggestion. The voltage comes from where? A Bluetooth module on a mini computer or what? What you do depends on how you measure the voltage and send that information to the Android.

hihi, thanks for replying, so far my in-developing apps can receive the data from arduino which means bluetooth connection is ok in my view, so in my apps the screen can show the 30. so now i need to add in one more step which is the conversion problem. but i cant find any suitable video on youtube which fulfil my requirement.

i am not familiar with the calculation part in mit apps, which means it will get the data as soon as arduino send the data successfully to the mit apps through bluetooth connection and convert it straight away. sorry if i am not clear, this is my 1st mit project apps. thanks anyway

We can't help with the blocks if you do not share....

Perhaps something like: mathGlucose

Here are some resources to help you learn to use the AI2 tools. A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.

There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles

How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .

Also look here http://kio4.com/appinventor/index.htm and here http://www.imagnity.com/tutorial-index/ for more tutorials

hi, thanks for replying , ok first of all, the voltage will be coming from my arduino hardware, then in my arduino coding, i have set the bluetooth connection which means arduino will send the voltage values to the mit apps and will display on the screen. Currently, the connection is successfull and the screen did show the value which is same in the serial monitor of arduino. So now, i have to add a text that shows the glucose level which is converted from the formula. So in the end, my screen will shows "voltage reading=30mV" and below shows "glucose level=90mg/dl" something like this. formula i give and example : "glucose level=voltage measured + 60" .

sorry i m new, so you mean i can share my current project izit?

thanks alot SteveJG. i will look forward on that

No, the actual formula (unless it really is your voltage value plus 60). In which case, why not just do this in the arduino code and send the final value ?

because i want to make a screen as shown in the image uploaded

glucose conc. =(voltage-0.8633)/0.00185

blocks (19)

You may need to adjust the voltage value coming through if it is in millivolts (/1000) ?

yes, the voltage measured from hardware is 430mV, so how do i adjust? Sorry i am not clear of "(/1000)". Sorry for the late reply, i used up my full post limit yesterday (didnt know that)

For the 1st picture, what does the warning means? "Sets this variable to be equal to the input".
For the 2nd picture, my bluetooth connection is successful and it shows the voltage reading as same as in serial monitor of arduino IDE. Just my glucose level does not get the value of voltage reading, so can be edited in the blocks editor? Thanks

1st Pic
That is the descriptive tool tip for the set variable block, it is not an error message
2nd Pic
in relation to your blocks Pic, you have not placed the calculation blocks in an event block anywhere, so it won't do anything! Put them at the end of the Clock Timer event ?