Programming with
Raspberry Pi
-Sudhakar S
What we will learn today?
• Introduction to Raspberry platform.
• Essentials of [Link] (H/W
components)
• Software side
• Developer Story
• Hands on with a Pi.
• It’s a Computer
• Inexpensive !
• Open H/W
• Powerful for that Size
Configuration
• 900 MHz Quad Core
ARM
Cortex-A7
• Broadcom SOC
• 1 GB RAM
• 4 USB Ports
• 40 GPIO pins
• Ethernet
• CSI (Camera
Interface)
• DSI (Display
Interface)
• Power Requirements
MicroSD Slot
• VideoCore IV 3D
• Headless – 5v -
500 mA
• Headed – 5v - 700
CPU RAM I/O (USB)
Ethernet(RJ45)
Controller
GPIO (Eth/USB)
Audio
Camera
DSI Display (CSI)
(DSI)
Storage Power
Interacting with Raspberry
USB Digital Signals
WebCams • General Purpose IO Pins (GPIO)
• Sensors
BT/Wifi dongles • Digital Hardware
Cameras etc • Micro Controllers
Remotes • Relays
IoT and Raspberry Pi
R-Pi Scenarios
• It’s a powerful little
computer…!
• Use it as a Hub for IoT
data or a Collector as
well
• Running Agents
• As a brain for any Robot
• Music Player, Media
Server, A Cloud Camera
More……!
Software
• Runs a special distro of Linux (Broadcom can run only Binary Blob
Drivers…So ! )
• Debian Linux was customized for Raspberry, thus “Raspbian”
• Special distro e.g. OpenELEC, OSMC, ARM Ports, OpenSUSE,
RaspbMC etc
• Official : NOOB (New Out Of the Box Software)
• New Kid on the Block : Windows 10 for IoT (We will have a
workshop on this later)
Let’s Boot-up
• Prepare your SD Card
• Format your SD card
• Option 1 Media : Burn bootable image in to SD Card
• Option 2 Media : Copy NOOB package in to SD Card root
• Connect your Pi to Peripherals
• Power-up and Go through installation Sequence
• Raspbian Walk-through
Connectivity
• Headed
• Using HDMI, USB
• XRDP sudo apt-get install xrdp
• VNC
• Headless
• SSH/Telnet (Headless)
Developer Options for Pi
• Frameworks / Runtime
• Python is available OOB
• MONO is linux port of .net (now checking in to git>dotnet core)
• Server Stack
• Apache
• NodeJS
• [Link]
• Databases
• MongoDB
Installing .net components
• Make sure all local package index is up to
date
sudo apt-get update
• Make sure all package information is up to
date
sudo apt-get install mono-complete
• Check the installation – CSharp Console
$ csharp
Sleeves Up !
• Introduction to GPIO
• Using GPIO
• Some .NET and python coding
• BCM - Broadcom pin number, commonly
called "GPIO”
Let’s blink LED using C#
• > New Console App
• Install Raspberry Sharp GPIO Library
PM> Install-Package [Link]
• Lets do two examples…
Resister : 220 ohms
Positive :
GPIO : 17
Pi Pin : 11
Ground:
GPIO : GND
Positive :
Pi Pin: 2
Ground:
GPIO : GND
VCC:
GPIO : GPIO 15
Pi Pin :
Post proximity data to
Cloud
• Prepare your device to make HTTPS Calls.
$ mozroots --import --ask-remove --machine
• Create a mobile service in Azure Portal
• Create a database for Mobile Service
• Create fields to capture the data