about ioio and android

38 views
Skip to first unread message

lu...@woobo.io

unread,
Aug 1, 2016, 4:21:36 PM8/1/16
to ioio-users
How can I give the value of ioioController.getBatteryVoltage() [A method I wrote to get battery voltage] to a variable I declared as a float in android.

The problem is that I need to do the try{} catch{} thing so I cant just say float b_v=ioioController.getBatteryVoltage();

And more I hope to toast it

Thanks guys for the help!

Ytai Ben-Tsvi

unread,
Aug 1, 2016, 4:25:17 PM8/1/16
to ioio-...@googlegroups.com

This doesn't seem like a IOIO specific question, but rather a general question about exception handling in Java.
In short, you have to either catch the exception or specify it as being thrown out of the calling method. Why is that a problem in your case?
See IOIOSimpleApp for an example for how to read analog inputs in case that's what you're doing.


--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

lu...@woobo.io

unread,
Aug 1, 2016, 6:34:35 PM8/1/16
to ioio-users
It's all right now, thanks for help.
Just put the b_v=ioioController.getBatteryVoltage();  within the try{ }
Reply all
Reply to author
Forward
0 new messages