Embedded Software Development with Python and the Raspberry Pi

Slides:



Advertisements
Similar presentations
Raspberry Pi The singing jelly baby.
Advertisements

By: Lloyd Albin 9/28/2012. We are not talking about a Raspberry Pie.
Wireless Ad Hoc and Sensor Networks Lab1. 2 Objective Comprehend how to setup and use the wireless communication devices, Jennic Evaluation System. You.
Embedded Programming and Robotics Lesson 19 Raspberry Pi Programming in C 1.
Remote Temperature Sensor and LED Control By: Man Nguyen Edwin Oilvos Osama Hassan.
Embedded Programming and Robotics Lesson 12 Introducing the Raspberry Pi Intro to Raspberry Pi1.
Embedded Programming and Robotics Lesson 13 Basic Linux 1.
Raspberry Pi Training Truman College Goals of our Training Today Unbox and boot up the Raspberry Pi (RPi) Learn how to access the desktop graphical.
SINGLE BOARD COMPUTERS -KEVIN JOSE. WHY DO WE USE THEM? Good performance at low price GPIO capability to interact with the outside world Small form factor,
1 © Bull, th September 2012 Dave Williams Lead Technical Architect Embedding Nagios in the Raspberry Pi.
Pi In The Sky Chris Stubbs. What’s in the HAB kit Balloon (keep this safe) Parachute PITS kit Raspberry Pi Model A (for flight) + SD + Camera Raspberry.
BBBK Programming Notes Rudra Dutta CSC , Fall, 2013.
baltrad node installation for beginners On Ubuntu Jesper Ellerbæk Nielsen Aalborg University, DK.
Embedded Programming and Robotics
Welcome to the world of ARM. COURSE CONTENT Module 1: Introduction  Introduction of ARM Processors  Evolution of ARM  32 - bit Programming Module 2:
Braille Printer An-Najah National University Faculty of Engineering Braille Printer Prepared by : Rbee waheeb Supervisor: Dr. Nidal Farahat May
IoT: Windows 10 & Raspberry Pi By: Mitchel Sellers.
Bonus EV3 Programming Lessons By Droids Robotics LEGO MINDSTORMS and Raspberry Pi IR Light controller.
Bonus EV3 Programming Lessons LEGO MINDSTORMS ev3dev and Raspberry Pi IR Light controller.
Presented by: © 2015 Jacob Beningo All Rights Reserved Writing Portable and Robust Firmware in C September 2, 2015 Jacob Beningo, CSDP Class 3: Uart Driver.
Presented by: © 2015 Jacob Beningo All Rights Reserved Writing Portable and Robust Firmware in C September 4, 2015 Jacob Beningo, CSDP Class 5: Robust.
Embedded Software Design Week II Linux Intro Linux Kernel.
Version Control Systems
Class 1: Building a Raspberry Pi LED Flasher
Embedded System Design Techniques™:
RASPBERRY PI WORKSHOP.
Implementation of Embedded OS
IoT 101 with Raspberry Pi and Azure
Dr. Kyung Eun Park Summer 2017
Internet of Things (internet of everything?)
Computer System Laboratory
Chapter A - The Raspberry Pi Computer
Running your own web server
Start developing with .NET Core and the Raspberry PI
Embedded Software Development with Python and the Raspberry Pi
The Raspberry Pi Initiative
Raspberry Pi <--> Arduino
A microcontroller Raspberry Pi 2 Model B V1.1 RPi
RASPBERRY PI WORKSHOP.
Machine Learning Workshop
Andrew Pruski SQL Server & Containers
Version Control Systems
Lab 1 introduction, debrief
Engineering Innovation Center
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
An Introduction to Embedded Software Architecture and Design
Baremetal C Programming for Embedded Systems
Internet-of-Things (IoT)
Internet-of-Things (IoT)
Embedded Software Development with Python and the Raspberry Pi
An Introduction to Embedded Software Architecture and Design
Journey: Introduction to Embedded Systems
Building an Internet of Things Device
Writing Portable and Robust Firmware in C
Writing Portable and Robust Firmware in C
February 26, 2015 Jacob Beningo, CSDP
Baremetal C Programming for Embedded Systems
Baremetal C Programming for Embedded Systems
RPi 2/3, I2C, Analog Sensor
Raspberry Pi – VNC Server Connection
GUI PROGRAMMING USING TKINTER to celebrate Translation Week
An Introduction to Embedded Software Architecture and Design
Software Setup & Validation
An Introduction to Embedded Software Architecture and Design
An Introduction to Embedded Software Architecture and Design
Embedded System Design Techniques™:
February 24, 2015 Jacob Beningo, CSDP
Copyright (c) 2017 by Dr. E. Horvath
Setting up a Webcam on a Raspberry Pi
Robot and Crickit HAT © Copyright 2019 by Dr. Elizabeth I. Horvath and Dr. Eva A. Horvath 1.
Presentation transcript:

Embedded Software Development with Python and the Raspberry Pi Class 4: Controlling Raspberry Pi Peripherals with Python August 21, 2014 Jacob Beningo, CSDP © All Images and content in this presentation may not be used or copied without express written permission of the owner.

Course Overview Introduction to Python Python Fundamentals An Overview of the Raspberry Pi Controlling Raspberry Pi Peripherals with Python An Internet of Things Weather Station Example

Session Overview Controlling Raspberry Pi Peripherals with Python The Raspberry Pi Ecosystem Library Setup GPIO Setup and Example I2C UART SPI Analog Sensors Pi Camera

Ecosystem

Library Setup Python Raspberry Pi Libraries Installation Steps Provide code modules to easily access hardware Easy to Install Installation Steps Update Packages Install GPIO Library Install git Install optional Adafruit Python Libraries

Library Setup – Update Packages sudo apt-get update

Library Setup – Install Python 2.7 sudo apt-get install python-dev

Library Setup – Install GPIO sudo apt-get install python-rpi.gpio

Library Setup - Optional Adafruit Libraries Useful interfaces for experimentation Install git sudo apt-get install git Clone Adafruit repository git clone http://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git cd Adafruit-Raspberry-Pi-Python-Code ls

Library Setup - Optional

A GPIO Example Goals Setup Toggle an LED using Python Adjustable blink rate Use of ctrl-c to exit application Setup Use nano GPIO18 as an output Use python sleep()

A GPIO Example

Setting Up I2C Add I2C modules sudo nano /etc/modules Don’t forget to reboot after this step! sudo reboot

Setting Up I2C Install I2C tools sudo apt-get install python-smbus sudo apt-get install i2c-tools Modify /etc/modprobe.d/raspi-blacklist.conf Don’t forget to restart after saving sudo reboot

Setting Up I2C sudo i2cdetect –y 1

Setting Up the UART UART0 by default is setup for Kernel Debugging

Setting Up the UART Run the UART Script Steps Disconnects the UART from Kernel Steps sudo wget https://raw.github.com/lurch/rpi-serial-console/master/rpi-serial-console -O /usr/bin/rpi-serial-console && sudo chmod +x /usr/bin/rpi-serial-console rpi-serial-console status Rpi-serial-console disable sudo reboot The script modifies the entries for ttyAMA0 in /boot/cmdline.txt /etc/inittab

Setting Up the UART Install python-serial Most likely already installed and up to date sudo apt-get install python-serial

Setting Up SPI Install Spi Wrapper mkdir python-spi cd python-spi wget https://raw.github.com/doceme/py-spidev/master/setup.py wget https://raw.github.com/doceme/py-spidev/master/spidev_module.c sudo python setup.py install

Setting Up SPI

Reading Analog Sensors Model: A / B / B+ Model: B+ Only

Reading Analog Sensors MCP3008 ADC Chip

Pi Camera Enable Camera Sudo raspi-config Reboot Python Test Script

Going Further Download Template Materials for Web Tutorials YouTube Python Doxygen Script Template Personal Weather Station Python Script Raspberry Pi Example Python Scripts Web Tutorials YouTube From www.beningo.com under Blog and Articles > Software Techniques > Embedded Software with Python

Contact Information P.O. Box 400 Linden, Michigan 48451 : jacob@beningo.com : 810-844-1522 : Jacob_Beningo : Beningo Engineering : JacobBeningo : Embedded Basics Jacob Beningo Principal Consultant © All Images and content in this presentation may not be used or copied without express written permission of the owner.