Pushbutton to send a command to a bluetooth controlled relay

504 views
Skip to first unread message

Muttleytm

unread,
Jun 8, 2016, 10:36:00 PM6/8/16
to MIT App Inventor Forum
I want to build a very simply app that will act as a garage door pushbutton switch emulator and work with bluetooth controlled relay.  I would like the relay to momentarily close just like the hardware switch has it do.  I have the code I need to send it to do this and can do it using the terminal like software the relay provided, but, it is sort of inconvenient.

I just need the ability to open the app, connect the my bluetooth relay then just push the button to activate the relay.

I have bluetooth terminal on my device and it seems like I could just have the pushbutton launch a script to do this using bluetooth terminal, but, I've never down any sort of programming with android.

So far using the app inventor I've put a pushbutton on the screen, but, I don't see how to add an action to a click event or connect the to the device.

Any ideas?

TIA

Taifun

unread,
Jun 9, 2016, 10:14:49 AM6/9/16
to MIT App Inventor Forum
this example might help

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 do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
 Top 5 Tips: How to learn  App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by  Taifun.         



Reply all
Reply to author
Forward
0 new messages