Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Beaglebone Essentials
  • Table Of Contents Toc
Beaglebone Essentials

Beaglebone Essentials

By : Rodolfo Giometti
5 (2)
close
close
Beaglebone Essentials

Beaglebone Essentials

5 (2)
By: Rodolfo Giometti

Overview of this book

If you are a developer with some hardware or electrical engineering experience who wants to learn how to use embedded machine-learning capabilities and get access to a GNU/Linux device driver to collect data from a peripheral or to control a device, this is the book for you.
Table of Contents (13 chapters)
close
close
12
Index

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Codes and command lines

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "To get the preceding kernel messages, we can use both the dmesg and tail -f /var/log/kern.log commands."

A block of code is set as follows:

#include <stdio.h>

int main(int argc, char *argv[])
{
        printf("Hello World!\n");

        return 0;
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

#include <stdio.h>

int main(int argc, char *argv[])
{
        printf("Hello World!\n");

        return 0;
}

Any command line input or output given on the BeagleBone Black is written as follows:

root@BeagleBone:~# make CFLAGS="-Wall -O2" helloworldcc -Wall -O2 helloworld.c -o helloworld

Any command line input or output given on my host computer as a non-privileged user is written as follows:

$ tail -f /var/log/kern.log

When I need to give a command as a privileged user (root) on my host computer the command line input or output is then written as follows:

# /etc/init.d/apache2 restart

The reader should notice that all privileged commands can be executed by a normal user too by using the sudo command with the form:

$ sudo <command>

So the preceding command can be executed by a normal user as:

$ sudo /etc/init.d/apache2 restart

Kernel and logging messages

On several GNU/Linux distribution a kernel message has the usual form:

Oct 27 10:41:56 hulk kernel: [46692.664196] usb 2-1.1: new high-speed USB device number 12 using ehci-pci

Which is a quite long line for this book, that's why the characters from the start of the lines till the point where the real information begin are dropped. So, in the preceding example, the lines output will be reported as follow:

usb 2-1.1: new high-speed USB device number 12 using ehci-pci

Long outputs, repeated or less important lines in a terminal are dropped by replacing them with three dots ... shown as follows:

output begin
output line 1
output line 2
...
output line 10
output end

File modifications

When the reader should modify a text file, I'm going to use the unified context diff format since this is a very efficient and compact way to represent a text modification. This format can be obtained by using the diff command with the -u option argument.

As a simple example, let's consider the following text into file1.old:

This is first line
This is the second line
This is the third line
...
...
This is the last line

Suppose we have to modify the third line as highlighted in the following snippet:

This is first line
This is the second line
This is the new third line modified by me
...
...
This is the last line

The reader can easily understand that reporting each time the whole file for a simple modification it's quite obscure and space consuming, however by using the unified context diff format the preceding modification can be written as follow:

$ diff -u file1.old file1.new
--- file1.old 2015-03-23 14:49:04.354377460 +0100
+++ file1.new 2015-03-23 14:51:57.450373836 +0100
@@ -1,6 +1,6 @@
 This is first line
 This is the second line
-This is the third line
+This is the new third line modified by me
 ...
 ...
 This is the last line

Now the modification is very clear and written in a compact form! It starts with a two-line header where the original file is preceded by --- and the new file is preceded by +++, then follows one or more change hunks that contain the line differences in the file. The preceding example has just one hunk where the unchanged lines are preceded by a space character, while the lines to be added are preceded by a + character and the lines to be removed are preceded by a - character.

Other conventions

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "If it prints Hello World, then our code has been executed successfully!"

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Beaglebone Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon