Skip to content

Raspberry.IO.GeneralPurpose

raspberry-sharp edited this page Oct 14, 2012 · 35 revisions

The Raspberry.IO.GeneralPurpose assembly provides access to the Raspberry Pi GPIO pins. This project is available under a compiled form under Nuget : see Raspberry.IO.GeneralPurpose Nuget.

Introduction

Raspberry.IO.GeneralPurpose namespace contains classes that provide three different levels of abstraction from the GPIO hardware pins:

  • IConnectionDriver interface and implementations provide raw, low-level access to the GPIO hardware.
  • GpioConnection classes and related components provide managed access to input/output pins
  • PinsBehavior class and inheritors provide a way to group multiple output pins and affect them a common behavior.

Getting Started

Basic access to the Raspberry Pi GPIO is done as follows: Identify pins on your Raspberry Pi board, following Raspberry Pin Numbering.

#####Declare Raspberry.IO.GeneralPurpose namespace: using Raspberry.IO.GeneralPurpose; Declare the pins : var led1 = ConnectorPin.P1Pin11.Output(); Create a connection to the GPIO var connection = new GpioConnection(led1); Use the connection to modify the pin status for(var i = 0; i < 100; i++){ connection.Toggle(led1); System.Threading.Thread.Sleep(250); } Close the connection connection.Close();

Reference

(to be done)

Samples

(to be done)

Clone this wiki locally