This document discusses using .NET to control blinken lights and GPIO pins on a Raspberry Pi. It provides an overview of GPIO concepts like voltage, digital pins for output and input, and communication protocols. It then demonstrates examples with .NET's System.Device.GPIO library to turn an LED on and off, read a push button, and interface with a temperature sensor and LED array using I2C and SPI protocols. The document emphasizes that .NET GPIO programming is similar but requires Linux/ARM targeting for Raspberry Pi.
10. Targeting a RaspberryPi
• Linux, not windows
• ARM32/64, not x86
• Recommendations:
• linux-arm runtime identifier
• Self-contained
• Publish profiles are great!
12. 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)
13. 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
15. 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