Notifications
Clear all

MIT AI2 and Bluetooth Bytes

4 Posts
2 Users
2 Likes
1,182 Views
(@tagivens)
Member
Joined: 4 years ago
Posts: 16
Topic starter  

Hey, I'm using MIT App Inventor 2 to make a simple app to monitor my kiddo's Power Wheels. I'm wanting to monitor battery voltage and motor temperatures. I can get the data and Serial.print it all.

Question is, how do I get AI2 to parse or separate the bytes to use them separately?

For example, battery voltage should be used to update a Label/Text field  "A" on the app. Temp for motor 1 should update the text for Label/Text B, and Temp for motor 2.. Label/Text C.  

For now, I'm just sending the serial data over Bluetooth and having the app receive it all and print it all in one larger box and it looks awful. 

 

Thanks!


   
Quote
Ruplicator
(@ruplicator)
Member
Joined: 4 years ago
Posts: 127
 

This looks very interesting. I have never used the App Inventor but it looks like it has a lot of possibilities. It sounds like you have done most of the hard work. 

It looks like you should be able to build your screen with labels and text boxes for each of the items you want to display. In the video below they use split text to break the received data into the appropriate labels. Check out the video below, I think it will help.

 


   
TAGivens reacted
ReplyQuote
(@tagivens)
Member
Joined: 4 years ago
Posts: 16
Topic starter  

That's exactly what I needed!   @13:50 shows what I had no clue about lol!  He's sending the bytes to a list and separating them with a specific character, then grabbing the list items and updating the labels' text.  Sweet! 

 

@Ruplicator, you should definitely check out the AI2 software. It's hosted online so there's nothing to download or install.  Extremely capable for making quick apps, and if you pair it with a HC05 module and an Arduino, you can get them to coneect and interact in just a few minutes.  

 

One of my future projects is going to be controlling relays for home automation devices and using a tablet mounted to the wall as the bluetooth client running a home-brewed app. Then have an app on my phone to go along with it, letting me update and retrieve values from a FirebaseDB database.  I did something similar with a Particle Photon sending CANBUS signals in my car to crack the windows when it got too hot inside and roll them up if it rained. Very handy in Texas lol!

 

 

Thanks again!!


   
ReplyQuote
Ruplicator
(@ruplicator)
Member
Joined: 4 years ago
Posts: 127
 

@tagivens

I'm glad it helped and I appreciate you posting a request for help as it got me to research AI2. Apparently it has been discussed on this forum before but that was before I joined. I do plan to include it in future projects and have passed the information along to my son who had an extensive IOT setup at his house.

I'm working on a weather station that uses an ESP32 MCU that includes WiFi. It would be a perfect match for AI2. However, I've already completed the UI using html that looks pretty good. But AI2 would have saved be days of research and trial and error.

I look forward to hearing about your future projects.


   
TAGivens reacted
ReplyQuote