Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

How to Make First Python Program with Beaglebone Black

By Ashish Vara

Beaglebone black supports various high level languages such as a C, C++ and scripting languages like java, python.  Programming of application is mostly written in C language for controller or processor. Python is an interpreted language and great library source available for BBB.  At low level, programming in python is efficient and  responds quicker than C language.

This tutorial talks about making first python program with Beaglebone Black. So in case you are not aware of basic python programming then I suggest you to go through the same before proceeding. You can also gain knowledge about BBB through the tutorial getting started with Beaglebone Black.

Install python on Beaglebone Black

Before starting programming, user is required to install python on Beaglebone black. Let’s check if the python is installed on the Beaglebone black or not. Enter the following command:

            dpkg -s python

 This command displays the information of package installation. If status is “Installed”, you can directly start with program.

 If python is not installed, install from debian repository by entering the following command. Before entering the command,  make sure that BBB has internet connection.

            Apt-get install python

Wait for completion of installation process and check once if   it’s working correctly or not.

Enter the following command form ssh command prompt:

python

Now it’s time to run Python. It is interpreted, so quick response is displayed after run instruction.

  

It is working perfectly, if the display on screen  is similar to the above image.

 

Run python from SSH command prompt in Beaglebone black

Let’s explain  a few instructions of python for understanding of concept. Refer to some online python tutorial or book if you want to learn python programming.

Enter the following line after right shift prompt and press ENTER key, if you want  to print some string on command terminal.

>>> print “Engineers Garage”

The following output is printed on screen:

Engineers Garage


 

Create a file in python and run from command terminal

Create a new folder in /root by entering following command:

mkdir project

Enter the following command from command terminal for entering in project directory:

cd project

Now create a new file with .py extension. Enter the following command:

touch print.py

Here print.py is name of flie. Open the file using any editor from terminal.    

            nano print.py

Copy the following code and paste in print.py file:

print “Hello Engineersgaragen”

print “Python script in BBBn”

Press ctrl+x and save the changes in file. Now, run the following command for run print.py file:

python print.py

The following output will be printed on screen:

Hello Engineersgarage

Python script in BBB


Filed Under: Tutorials

 

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver
  • Introduction to Brain Waves & its Types (Part 1/13)

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Advice for my disabled son please
  • 12V 5A needed
  • Vco cadencd
  • DA14531 Bluetooth and Xamarin.
  • 7 segment display connections

RSS Electro-Tech-Online.com Discussions

  • Disabled son needs advice please
  • Confirming whether this circuit will work
  • How does a blinky/flashing ball work?
  • I've DESTROYED 3 piezo buttons :((((
  • Control Bare LCD With ATmega328p
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering