Arduino sensor data real time plot in android app

515 views
Skip to first unread message
is duplicateview conversation

Dineth Senevirathne

unread,
Nov 5, 2017, 11:31:49 PM11/5/17
to MIT App Inventor Forum
hello,
i recently developed an arduino code which outputs 2 float values. i sent these 2 values to the android phone via Bluetooth using an small app made with app inventor. now i want to plot these values on a real time scatter plot.can anybody guide me how to plot the values in a real time plot.

Ghica

unread,
Nov 6, 2017, 7:26:08 AM11/6/17
to MIT App Inventor Forum

Abraham Getzler

unread,
Nov 6, 2017, 11:15:17 AM11/6/17
to MIT App Inventor Forum
This sample app in the Gallery plots random shrinking
disks on a Canvas.

You can adapt it to use incoming x,y values instead,
with the appropriate scale factors.

I suggest a couple of sliders to set the scale factors.


ABG

Dineth Senevirathne

unread,
Nov 6, 2017, 6:32:19 PM11/6/17
to MIT App Inventor Forum
also there is another issue,
i receive two values as a string like (23.56,89.34)
How can i separate  these values as 23.56 and 89.34 and save in 2 variables? (like buffers)

Abraham Getzler

unread,
Nov 6, 2017, 7:00:14 PM11/6/17
to MIT App Inventor Forum
Are the () included?

If not, just take the string and use a split at comma block to turn it into a list,
and select them by index using a list block.

To remove (), use the text replace block.

ABG

Dineth Senevirathne

unread,
Nov 6, 2017, 9:13:29 PM11/6/17
to MIT App Inventor Forum
it is without ().
of i seperate two values with comma.
how can i use these values to plot the graphs.( how can i plot the x,y values using above list?)are there any conversion method from string to float?

Abraham Getzler

unread,
Nov 7, 2017, 8:28:54 AM11/7/17
to MIT App Inventor Forum
are there any conversion method from string to float

AI2 numeric type conversion is automatic (Duck Typing)

how can i use these values to plot the graphs.( how can i plot the x,y values using above list?

Before you tackle realtime graphing,
maybe you should review a few examples of static charting
to get a feel for how to scale values to the Canvas size.

See the Charts and Graphs section of this FAQ:
for samples.

Also use the search bar in this page for "realtime chart" in case you get lucky.

ABG

 
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages