Send battery information with bluetooth to arduino appinventor batteryextension

334 views
Skip to first unread message

Xavi

unread,
May 18, 2017, 5:13:26 PM5/18/17
to MIT App Inventor Forum
Hello .

I've only been with app inventor for two days and I still do not know how it works. I'm using app inventor with battery extension.

And I want to send the information of the battery level and the voltage by bluetooth to a arduino device and I can not do it

thanks to all.

Andres Daniel

unread,
May 18, 2017, 7:21:05 PM5/18/17
to MIT App Inventor Forum
puedes describir tu proyecto y que quieres realizar

Xavi

unread,
May 18, 2017, 7:43:40 PM5/18/17
to MIT App Inventor Forum


I want to make a smart charger that connects with bluetooth with a cell phone or tablet. When the battery is almost full (70-80% or 4,200 mV) send a signal to the Arduino and this activates an output with a relay to disconnect the current and when the battery is at 30% recharge the battery


Hola Andres, quiero hacer un cargador inteligente que se conecte con bluetooth con un movil o tablet. Cuando la batería este casi llena (70-80% o con 4.200 mV) envié una señal al arduino y este active una salida con un rele para desconectar la corriente  y cuando la batería este al 30% vuelva a cargar la batería 

Abraham Getzler

unread,
May 18, 2017, 10:38:05 PM5/18/17
to MIT App Inventor Forum

Ghica

unread,
May 19, 2017, 3:46:05 AM5/19/17
to MIT App Inventor Forum
But be aware that App Inventor cannot run in the background. That may be a showstopper for your project.
Cheers, Ghica.

Andres Daniel

unread,
May 21, 2017, 2:01:21 PM5/21/17
to MIT App Inventor Forum
si se puede

Xavi

unread,
May 23, 2017, 7:48:48 AM5/23/17
to MIT App Inventor Forum
Hello finally i did it! but now i do this app and i don't know the app in my phone crush...
Captura.JPG

Ghica

unread,
May 23, 2017, 8:56:42 AM5/23/17
to MIT App Inventor Forum
That is not surprising. You did something completely terrible: a while test with a condition that may or may not end. You are sending messages to your BT device like gunfire instead of once per second (or whatever interval you have set) when the Timer goes of.
Replace the while test with if..then and you should be fine. You can also use just one clock by placing both ifs below each other, or if you want to be really fancy, use if-then-else
Cheers, Ghica.

Xavi

unread,
May 23, 2017, 9:16:07 AM5/23/17
to MIT App Inventor Forum

You're right Ghica

I realized before but thank you very much. Thanks to you I improved the app! thank you
Reply all
Reply to author
Forward
0 new messages