Book Image

Banana Pro Blueprints

By : Tony Zhang
Book Image

Banana Pro Blueprints

By: Tony Zhang

Overview of this book

This book follows a tactical plan that will guide you through the implementation of Banana Pro and its configurations. You will then learn the various programming languages used with Banana Pi with the help of examples. In no time at all, you’ll be working on a wireless project that implements AirPlay servers, hotspots, and so on. Following this, you’ll develop a retro-style arcade kiosk game. Then we’ll move on to explore the multimedia features of Banana Pro by designing and building an enclosure for it. After this, you’ll learn to build a remote-controlled smart car and we’ll examine how to control a robotic arm. The book will conclude with the creation of a home sensor system that has the ability to expand or shrink to suit any home.
Table of Contents (15 chapters)
Banana Pro Blueprints
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Shell programming


A Linux shell is a command line interpreter that provides a user interface for a system itself. It can be used to install programs (apt-get install) or even for some programming, including conditions, logic, or loops. Linux provides many different shells. Very often, the Bourne shell is used, which was developed in the 70s by Stephen R. Bourne. This shell provides input and output redirection, pipes, background processes, and much more. For all Linux systems, a Bourne-compatible shell in the /bin/sh directory is available.

Checking the Banana Pro temperature

Let's start our first shell program using these steps:

  1. Edit a file called temperature and place the following content in it:

    #!/bin/sh
    cat /sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input
    
  2. Save the file afterwards and make it executable:

    chmod 775 temperature
    
  3. Execute this file by typing this:

    ./temperature
    

My output shows 36200, which is the Banana Pro temperature multiplied by 1,000. The first line of the temperature...