Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Internet of Things Programming Projects

You're reading from   Internet of Things Programming Projects Build modern IoT solutions with the Raspberry Pi 3 and Python

Arrow left icon
Product type Paperback
Published in Oct 2018
Publisher Packt
ISBN-13 9781789134803
Length 436 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Colin Dow Colin Dow
Author Profile Icon Colin Dow
Colin Dow
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Installing Raspbian on the Raspberry Pi FREE CHAPTER 2. Writing Python Programs Using Raspberry Pi 3. Using the GPIO to Connect to the Outside World 4. Subscribing to Web Services 5. Controlling a Servo with Python 6. Working with the Servo Control Code to Control an Analog Device 7. Setting Up a Raspberry Pi Web Server 8. Reading Raspberry Pi GPIO Sensor Data Using Python 9. Building a Home Security Dashboard 10. Publishing to Web Services 11. Creating a Doorbell Button Using Bluetooth 12. Enhancing Our IoT Doorbell 13. Introducing the Raspberry Pi Robot Car 14. Controlling the Robot Car Using Python 15. Connecting Sensory Inputs from the Robot Car to the Web 16. Controlling the Robot Car with Web Service Calls 17. Building the JavaScript Client 18. Putting It All Together 19. Assessments 20. Other Books You May Enjoy

A quick overview of the Raspbian OS

The Raspbian desktop is similar to the desktops of other operating systems such as Windows and macOS. Clicking the top-left button drops down the application menu where you may access the various pre-installed programs. We may also shut down the Raspberry Pi from this menu:

The Chromium web browser

The second button from the left loads the Google Chromium web browser for the Raspberry Pi:

The Chromium browser is a lightweight browser that runs remarkably well on the Raspberry Pi:

The home folder

The two-folders button opens up a window showing the home folder:

The home folder is a great place to start when looking for files on your Raspberry Pi. In fact, when you take screenshots using either the scrot command or the Print Screen button, the file is automatically stored in this folder:

The Terminal

The third button from the left opens up the Terminal. The Terminal permits command-line access to Raspberry Pi's files and programs:

It is from the command line where you may update the Raspberry Pi using the sudo apt-get update and sudo apt-get dist-upgrade commands.

apt-get updates the packages list, and apt-get dist-upgrade updates the packages:

It's a good idea to run both of these commands right after installing Raspbian using the sudo command. The default user for Raspbian on the Raspberry Pi is pi, which is part of the Super Users group in Raspbian, and thus must use the sudo command (the default password for the pi user is raspberry):

Mastering the command line is a virtue that many a programmer aspires to acquire. Being able to rapidly type command after command looks so cool that even movie makers have picked up on it (when was the last time you saw the computer wiz in a movie clicking around the screen with a mouse?). To assist you in becoming this uber cool computer wiz, here are some basic Raspbian commands for you to master using the Terminal:

ls: Command to see the contents of the current directory
cd: Command to change directories. For example, use cd to move up a directory from where you currently are
pwd: Command to display the directory you are currently in
sudo: Allows the user to perform a task as the super user
shutdown: Command that allows the user to shut down the computer from the Terminal command line

Mathematica

The third and fourth buttons are for Mathematica, and a terminal to access the Wolfram language, respectively:

Mathematica spans all areas of technical computing and uses the Wolfram language as the programming language. The areas in which Mathematica is used include machine learning, image processing, neural networks and data science:

Mathematica, a proprietary software first released in 1988, can be used free for individuals on the Raspberry Pi through a partnership that was announced in late 2013.

Now let’s take a look at some of the programs that are accessed from the main drop-down menu.

Sonic Pi

Sonic Pi is a live coding environment for creating electronic music. It is accessed from the Programming menu option. Sonic Pi is a creative way to create music as the user programs loops, arpeggios, and soundscapes in real time by cutting and pasting code from one part of the app to another. Synthesizers in Sonic Pi may be configured on a deep level, providing a customized experience for the music coder:

Geared toward an EDM style of music, Sonic Pi may also be used to compose classical and jazz styles of music.

Scratch and Scratch 2.0

Scratch and Scratch 2.0 are visual programming environments designed for teaching programming to children. Using Scratch, the programmer creates their own animations with looping and conditional statements.

Games may be created within the program. The first version of Scratch was released in 2003 by the Lifelong Kindergarten group at the MIT media lab. Scratch 2.0 was released in 2013, and development is currently underway with Scratch 3.0:

Scratch and Scratch 2.0 may be accessed under the Programming menu option.

LibreOffice

LibreOffice is a free and open source office suite that forked over from OpenOffice in 2010. The LibreOffice suite consists of a word processor, a spreadsheet program, a presentation program, a vector graphics editor, a program for creating and editing mathematical formulae, and a database management program. The LibreOffice suite of programs may be accessed through the LibreOffice menu option:

You have been reading a chapter from
Internet of Things Programming Projects
Published in: Oct 2018
Publisher: Packt
ISBN-13: 9781789134803
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image