SlideShare a Scribd company logo
1 of 24
Blinken' Lights with .NET
Scott Holden
./GPIO
General-purpose input/output.
Voltage
Battery
Power Source
Positive
Negative
Vcc
Gnd
5v
3.3v
Digital Pins - Output
• 2 states, HIGH or LOW
• 1 or 0, true or false
• At high, Vcc
• At low, Gnd
• This depends, but is fine as a concept
./RaspiDemo/0-BashGPIO
Turn on all the lights!
Pin 20
Gnd
LED
Resistor
Recap
• /sys/class/gpio… directory
• ‘export’ pins to enable them
• echo 20 > ./export
• ‘direction’ defines input/output
• echo out > ./gpio20/direction
• ‘value’ defines high/low
• echo 1 > ./gpio20/value
./System.Device.GPIO
Less bash, more sharp!
System.Device.GPIO
• github.com/dotnet/iot
• src/System.Device.Gpio – Main NuGet package
• src/devices – Devices NuGet package
• Abstraction from OS/Hardware
• Different binding for each platform
• Still in experimental stage
./Targets/Raspi
Same but different?
Targeting a RaspberryPi
• Linux, not windows
• ARM32/64, not x86
• Recommendations:
• linux-arm runtime identifier
• Self-contained
• Publish profiles are great!
./RaspiDemo/1-SimpleLight
On, off, on, off...
Pin 20
Gnd
LED
Resistor
Recap
• Setup GpioController
• new GpioController()
• ‘Open’ pins before use
• controller.OpenPin(x)
• Set the pin ‘mode’ to output
• controller.SetPinMode(x, PinMode.Output)
• ‘Write’ to the pin to turn it on
• controller.Write(x, PinValue.High)
Digital Pins - Input
• 2 states, HIGH or LOW
• 1 or 0, true or false
• At high, Vcc-ish is expected*
• At low, Gnd-ish is expected*
• Pull-up/pull-down
• Connecting to Vcc/Ground internally
./RaspiDemo/2-PushButton
Don’t press the big red button!
Pin 5
Gnd Switch
Vcc Resistor
Resistor
Recap
• Setup GpioController
• new GpioController()
• ‘Open’ pins before use
• controller.OpenPin(x)
• Set the pin ‘mode’ to input
• controller.SetPinMode(x, PinMode.Input)
• ‘Read’ the pin to check if it is on
• controller.Read(x) == PinValue.High
./RaspiDemo/3-Reaction
How fast is too fast?
Pin 5
Gnd Switch
Vcc Resistor
ResistorPin 20 LED Resistor
Pin 22 LED Resistor
./BeyondGPIO
1-wire, 2 wire, 3 wire, 4!
Communication Protocols
• 1-wire
• Simple low speed signaling
• I2C
• Primary chips/devices, One or more secondary
• 2 wires, simple signaling
• SPI
• 4 wires: data in, data out, clock & chip select
./RaspiDemo/4-TempApi
1-wire is more than enough!
Vcc
Pin 13
Gnd
DHT11
Sensor
1-wire
./RaspiDemo/5-LEDArray
Shine on!
Vcc
MOSI
LED
Matrix
Gnd
CLK
CE0
./FinalNotes
Differences
!=
Getting Started
• RaspberryPi
• MicroSD card
• 5v power source
• Breakout cable*
• Jumpers/leads
• Breadboard
• Sensors/lights/switches/motors
./Thanks
github.com/ScottHolden

More Related Content

What's hot

PM16 Technical Specification 20022013
PM16 Technical Specification 20022013PM16 Technical Specification 20022013
PM16 Technical Specification 20022013Rimsky Cheng
 
Digital clock presentation
Digital clock presentationDigital clock presentation
Digital clock presentationAditya Jha ✅
 
Digital stop watch
Digital stop watchDigital stop watch
Digital stop watchviv3ksharma
 
Etapes fab-venti-v2
Etapes fab-venti-v2Etapes fab-venti-v2
Etapes fab-venti-v2Jonah Marrs
 
Digital clock
Digital clockDigital clock
Digital clockAbi Malik
 
Up and running with Teensy 3.1
Up and running with Teensy 3.1Up and running with Teensy 3.1
Up and running with Teensy 3.1yoonghm
 
555 TIMER IC & its APPLICATION
555 TIMER IC & its APPLICATION555 TIMER IC & its APPLICATION
555 TIMER IC & its APPLICATIONSubham Dhar
 
Presentation2 1-150523155048-lva1-app6892
Presentation2 1-150523155048-lva1-app6892Presentation2 1-150523155048-lva1-app6892
Presentation2 1-150523155048-lva1-app6892Nirav rathod
 
Arduino workshop
Arduino workshopArduino workshop
Arduino workshopJonah Marrs
 
22 Microcontroller Programs
22 Microcontroller Programs22 Microcontroller Programs
22 Microcontroller Programsbabak danyal
 
Room illumination
Room illuminationRoom illumination
Room illuminationlalmo
 
Power the world with mbed LPC1768
Power the world with mbed LPC1768Power the world with mbed LPC1768
Power the world with mbed LPC1768yoonghm
 

What's hot (20)

PM16 Technical Specification 20022013
PM16 Technical Specification 20022013PM16 Technical Specification 20022013
PM16 Technical Specification 20022013
 
555 timer tutorial
555 timer tutorial555 timer tutorial
555 timer tutorial
 
Digital clock presentation
Digital clock presentationDigital clock presentation
Digital clock presentation
 
Digital stop watch
Digital stop watchDigital stop watch
Digital stop watch
 
Cable pDRIVE
Cable pDRIVECable pDRIVE
Cable pDRIVE
 
Etapes fab-venti-v2
Etapes fab-venti-v2Etapes fab-venti-v2
Etapes fab-venti-v2
 
Digital clock
Digital clockDigital clock
Digital clock
 
Ports 0f 8051
Ports 0f 8051Ports 0f 8051
Ports 0f 8051
 
Up and running with Teensy 3.1
Up and running with Teensy 3.1Up and running with Teensy 3.1
Up and running with Teensy 3.1
 
555 timer ppt by vishnu
555 timer ppt by vishnu555 timer ppt by vishnu
555 timer ppt by vishnu
 
555 TIMER IC & its APPLICATION
555 TIMER IC & its APPLICATION555 TIMER IC & its APPLICATION
555 TIMER IC & its APPLICATION
 
Presentation2 1-150523155048-lva1-app6892
Presentation2 1-150523155048-lva1-app6892Presentation2 1-150523155048-lva1-app6892
Presentation2 1-150523155048-lva1-app6892
 
Digital stop watch
Digital stop watchDigital stop watch
Digital stop watch
 
Arduino workshop
Arduino workshopArduino workshop
Arduino workshop
 
22 Microcontroller Programs
22 Microcontroller Programs22 Microcontroller Programs
22 Microcontroller Programs
 
Room illumination
Room illuminationRoom illumination
Room illumination
 
555 timer
555 timer555 timer
555 timer
 
8051 ports
8051 ports8051 ports
8051 ports
 
Power the world with mbed LPC1768
Power the world with mbed LPC1768Power the world with mbed LPC1768
Power the world with mbed LPC1768
 
2th year iv sem de lab manual
2th year iv sem de lab manual2th year iv sem de lab manual
2th year iv sem de lab manual
 

Similar to Blinken' Lights with .NET

Any Surface Drum Kit
Any Surface Drum Kit Any Surface Drum Kit
Any Surface Drum Kit ViVek Patel
 
Raspberry Pi GPIO Tutorial - Make Your Own Game Console
Raspberry Pi GPIO Tutorial - Make Your Own Game ConsoleRaspberry Pi GPIO Tutorial - Make Your Own Game Console
Raspberry Pi GPIO Tutorial - Make Your Own Game ConsoleRICELEEIO
 
PISO shift register
PISO shift registerPISO shift register
PISO shift registerisaacmalca
 
02 Raspberry Pi GPIO Interface on Node-RED (Some correction)
02 Raspberry Pi GPIO Interface on Node-RED (Some correction)02 Raspberry Pi GPIO Interface on Node-RED (Some correction)
02 Raspberry Pi GPIO Interface on Node-RED (Some correction)Mr.Nukoon Phimsen
 
London Nanode Applications Weekend OpenEnergyMonitor presentation
London Nanode Applications Weekend OpenEnergyMonitor presentation London Nanode Applications Weekend OpenEnergyMonitor presentation
London Nanode Applications Weekend OpenEnergyMonitor presentation OpenEnergyMonitor
 
Embedded Systems: Lecture 9: The Pi Control ARM
Embedded Systems: Lecture 9: The Pi Control ARMEmbedded Systems: Lecture 9: The Pi Control ARM
Embedded Systems: Lecture 9: The Pi Control ARMAhmed El-Arabawy
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to ArduinoQtechknow
 
Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Tom Paulus
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptxHebaEng
 
Internet of Things With PHP
Internet of Things With PHPInternet of Things With PHP
Internet of Things With PHPAdam Englander
 
Using ARM Dev.Board in physical experimental instruments
Using ARM Dev.Board in physical experimental instrumentsUsing ARM Dev.Board in physical experimental instruments
Using ARM Dev.Board in physical experimental instrumentsa_n0v
 
Product Brief Mini Dsp
Product Brief Mini DspProduct Brief Mini Dsp
Product Brief Mini DspAntoine Rouget
 
Got Python I/O: IoT Develoment in Python via GPIO
Got Python I/O: IoT Develoment in Python via GPIOGot Python I/O: IoT Develoment in Python via GPIO
Got Python I/O: IoT Develoment in Python via GPIOAdam Englander
 
Chromation systems 24-channel-usb-connected-led-controller-v3
Chromation systems 24-channel-usb-connected-led-controller-v3Chromation systems 24-channel-usb-connected-led-controller-v3
Chromation systems 24-channel-usb-connected-led-controller-v3nadimsh90
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacingRAMPRAKASHT1
 
Product Brief Mini Dsp Kit Balanced
Product Brief Mini Dsp Kit BalancedProduct Brief Mini Dsp Kit Balanced
Product Brief Mini Dsp Kit BalancedAntoine Rouget
 
LinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrumentLinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrumentGeert Bevin
 

Similar to Blinken' Lights with .NET (20)

Any Surface Drum Kit
Any Surface Drum Kit Any Surface Drum Kit
Any Surface Drum Kit
 
Raspberry Pi GPIO Tutorial - Make Your Own Game Console
Raspberry Pi GPIO Tutorial - Make Your Own Game ConsoleRaspberry Pi GPIO Tutorial - Make Your Own Game Console
Raspberry Pi GPIO Tutorial - Make Your Own Game Console
 
PISO shift register
PISO shift registerPISO shift register
PISO shift register
 
02 Raspberry Pi GPIO Interface on Node-RED (Some correction)
02 Raspberry Pi GPIO Interface on Node-RED (Some correction)02 Raspberry Pi GPIO Interface on Node-RED (Some correction)
02 Raspberry Pi GPIO Interface on Node-RED (Some correction)
 
London Nanode Applications Weekend OpenEnergyMonitor presentation
London Nanode Applications Weekend OpenEnergyMonitor presentation London Nanode Applications Weekend OpenEnergyMonitor presentation
London Nanode Applications Weekend OpenEnergyMonitor presentation
 
Embedded Systems: Lecture 9: The Pi Control ARM
Embedded Systems: Lecture 9: The Pi Control ARMEmbedded Systems: Lecture 9: The Pi Control ARM
Embedded Systems: Lecture 9: The Pi Control ARM
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
 
Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013
 
IoT Aquarium 2
IoT Aquarium 2IoT Aquarium 2
IoT Aquarium 2
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Internet of Things With PHP
Internet of Things With PHPInternet of Things With PHP
Internet of Things With PHP
 
Using ARM Dev.Board in physical experimental instruments
Using ARM Dev.Board in physical experimental instrumentsUsing ARM Dev.Board in physical experimental instruments
Using ARM Dev.Board in physical experimental instruments
 
Product Brief Mini Dsp
Product Brief Mini DspProduct Brief Mini Dsp
Product Brief Mini Dsp
 
Got Python I/O: IoT Develoment in Python via GPIO
Got Python I/O: IoT Develoment in Python via GPIOGot Python I/O: IoT Develoment in Python via GPIO
Got Python I/O: IoT Develoment in Python via GPIO
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
 
Chromation systems 24-channel-usb-connected-led-controller-v3
Chromation systems 24-channel-usb-connected-led-controller-v3Chromation systems 24-channel-usb-connected-led-controller-v3
Chromation systems 24-channel-usb-connected-led-controller-v3
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
 
Product Brief Mini Dsp Kit Balanced
Product Brief Mini Dsp Kit BalancedProduct Brief Mini Dsp Kit Balanced
Product Brief Mini Dsp Kit Balanced
 
LinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrumentLinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrument
 

Recently uploaded

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Blinken' Lights with .NET