Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • BeagleBone By Example
  • Toc
  • feedback
BeagleBone By Example

BeagleBone By Example

By : Prabakar
5 (1)
close
BeagleBone By Example

BeagleBone By Example

5 (1)
By: Prabakar

Overview of this book

BeagleBone is a low cost, community-supported development platform to develop a variety of electronic projects. This book will introduce you to BeagleBone and get you building fun, cool, and innovative projects with it. Start with the specifications of BeagleBone Black and its operating systems, then get to grips with the GPIOs available in BeagleBone Black. Work through four types of exciting projects: building real-time physical computing systems, home automation, image processing for a security system, and building your own tele-controlled robot and learn the fundamentals of a variety of projects in a single book. By the end of this book, you will be able to write code for BeagleBone in order to operate hardware and impart decision-making capabilities with the help of efficient coding in Python.
Table of Contents (12 chapters)
close
11
Index

Advanced project: An Internet controlled power switch – controlling an AC bulb from the Internet


Now we have set up the circuit from the previous topic, we will code it on Python to switch the GPIO to HIGH and LOW from the web page. You can proceed and write the code as shown in the following screenshot:

Now save the file as GPIOControlWebApp.py.

Let's run the code to switch the lamp on and off, and go ahead and open the page from the Android tablet. The tablet is connected to the same LAN Wi-Fi router as the BeagleBone board. Click the on and off buttons and you will see the output in the shell terminal as shown in the following screenshot:

And the bulb will turn on and off as shown in the following pictures:

Bulb is in the off state

Bulb is in the on state

But right now, we are just doing this on our local network within our home router LAN network to which the BeagleBone board is connected. What if we wanted to control the bulb via a 3G connection available on our phone? In this case you need...

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete