Como fazer o primeiro programa Python com Beaglebone Black

How to make your first Python program with Beaglebone Black

Beaglebone black supports several high-level languages ​​like C, C++ and scripting languages ​​like java, python. Application programming is mainly written in C language for controller or processor. Python is an interpreted language and a great library source available for BBB. At low level, Python programming is efficient and responds faster than C language.

This tutorial talks about how to create the first python program with Beaglebone Black. So, if you don't know basic Python programming, I suggest you do the same before continuing. You can also gain knowledge about the BBB through the tutorial starting with Beaglebone Black.

Install python on Beaglebone Black

Before starting programming, the user must install python on Beaglebone black. Let's check whether python is installed on Beaglebone black or not. Enter the following command:

dpkg -s python

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

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

Apt-get install python

Wait for the installation process to complete and check once whether it is working properly or not.

Enter the following ssh command prompt in the command form:

Phyton

Now it's time to run Python. It is interpreted, so a quick response is displayed after the execute statement.

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

Run python from SSH command prompt on Beaglebone black

Let's explain some python instructions to understand the concept. Refer to some online python tutorial or book if you want to learn python programming.

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

>>> print “Engineers’ Garage”

The following output is printed on the screen:

Engineers Garage


Create a file in Python and run it in the command terminal

Create a new folder in /root by typing the following command:

mkdir project

Enter the following command in the command terminal to enter the project directory:

CD project

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

tap print.py

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

nanoprint.py

Copy the following code and paste it into the print.py file:

print “Hello Engenheirosgaragen”

print “Python script in BBBn”

Press Ctrl+x and save changes to the file. Now, run the following command to run the print.py file:

python print.py

The following output will be printed on the screen:

Hello Engineersgarage

Python script on BBB

Conteúdo Relacionado

A network of sensors is embedded in every vehicle,...
The motor controller is one of the most important...
ESP32-CAM is a compact camera module that combines the...
A evolução dos padrões USB foi fundamental para moldar...
A SCHURTER anuncia um aprimoramento para sua conhecida série...
A Sealevel Systems anuncia o lançamento da Interface Serial...
A STMicroelectronics introduziu Diodos retificadores Schottky de trincheira de...
Determinar uma localização precisa é necessário em várias indústrias...
O novo VIPerGaN50 da STMicroelectronics simplifica a construção de...
A Samsung Electronics, fornecedora de tecnologia de memória avançada,...
O mercado embarcado tem uma necessidade de soluções de...
You have probably come across the term ' drag...
You probably have a support insulator if you've noticed...
You've probably seen stand an insulator sit on power...
You've probably seen shackle insulators enthroned on electricity poles,...
You have probably experienced situations where controlling a circuit...
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.