Reader small image

You're reading from  Raspberry Pi Essentials

Product typeBook
Published inApr 2015
Publisher
ISBN-139781784396398
Edition1st Edition
Right arrow
Author (1)
Jack Creasey
Jack Creasey
author image
Jack Creasey

Jack Creasey has been in the technology industry for more than 30 years, the last 15 years as a Senior Program Manager in hardware and software design. His expertise includes designing, developing, and teaching IT courseware. He is an avid inventor and holds 13 patents in hardware and software design. After retiring early from the computing industry, Jack avidly participates in social network groups that share his passion for next generation technology solutions.
Read more about Jack Creasey

Right arrow

Implementing rwheel.py


The third module we will explore is rwheel.py; it uses the smbus library to access I2C peripherals. If you remember, back in Chapter 6, Driving I2C Peripherals on the Raspberry Pi, the use of the smbus library functions requires root privileges and is limited to Python 2. At that time, we suggested starting the Python 2 IDLE IDE using the sudo idle command line. This strategy resolved a potential development problem, so again, you should start IDLE from the command line. We will programmatically set the required privileges when we use all the programs together.

Downloading rwheel.py and test-rwheel.py

To download rwheel.py and test-rwheel.py files, perform the following steps:

  1. Use the command line to open a new instance using sudo idle.

  2. Download the rwheel.py and test-rwheel.py from the Chapter 8 folder at http://1drv.ms/1ysAxkl.

  3. Open rwheel.py in the Python IDE.

  4. Review the key functions in the following table:

    lock icon
    The rest of the page is locked
    Previous PageNext Page
    You have been reading a chapter from
    Raspberry Pi Essentials
    Published in: Apr 2015Publisher: ISBN-13: 9781784396398

    Author (1)

    author image
    Jack Creasey

    Jack Creasey has been in the technology industry for more than 30 years, the last 15 years as a Senior Program Manager in hardware and software design. His expertise includes designing, developing, and teaching IT courseware. He is an avid inventor and holds 13 patents in hardware and software design. After retiring early from the computing industry, Jack avidly participates in social network groups that share his passion for next generation technology solutions.
    Read more about Jack Creasey

    Function

    Description

    main()

    This function calls the PCA9685_reset...