All Projects → AlexSartori → Raspberry Gpio Manager

AlexSartori / Raspberry Gpio Manager

Licence: mit
A basic library to manage the GPIO pins on a Raspberry Pi with C Sharp.

Projects that are alternatives of or similar to Raspberry Gpio Manager

Raspberryio
The Raspberry Pi's IO Functionality in an easy-to-use API for Mono/.NET/C#
Stars: ✭ 593 (+812.31%)
Mutual labels:  raspberry-pi, mono
Mmalsharp
C# wrapper to Broadcom's MMAL with an API to the Raspberry Pi camera.
Stars: ✭ 152 (+133.85%)
Mutual labels:  raspberry-pi, mono
Teslalogger
Stars: ✭ 131 (+101.54%)
Mutual labels:  raspberry-pi, mono
Embedio
A tiny, cross-platform, module based web server for .NET
Stars: ✭ 1,007 (+1449.23%)
Mutual labels:  raspberry-pi, mono
Ip Kvm Interface
DIY IP-KVM for Remote Desktop Access
Stars: ✭ 62 (-4.62%)
Mutual labels:  raspberry-pi
Syn Speech
Syn.Speech is a flexible speaker independent continuous speech recognition engine for Mono and .NET framework
Stars: ✭ 57 (-12.31%)
Mutual labels:  mono
Play stdin.sh
A set of lightweight scripts to stream audio between two *nix machines. Perfect for use with a Raspberry Pi
Stars: ✭ 56 (-13.85%)
Mutual labels:  raspberry-pi
Picroscopy
A Python web-application to turn a Raspberry Pi and PiCam into a microscopy solution
Stars: ✭ 54 (-16.92%)
Mutual labels:  raspberry-pi
Opencv 3.2.0 Compiling On Raspberry Pi
Download, Compile, Build, and Install OpenCV 3.2.0 with Extra Modules on RPI running Jessie
Stars: ✭ 65 (+0%)
Mutual labels:  raspberry-pi
Q3lite
Q3lite, an OpenGL ES port of Quake III Arena for embedded Linux systems.
Stars: ✭ 64 (-1.54%)
Mutual labels:  raspberry-pi
Socketclusterclientdotnet
C# client for socketcluster framework in node.js
Stars: ✭ 60 (-7.69%)
Mutual labels:  mono
Magicmirror
树莓派智能镜子
Stars: ✭ 57 (-12.31%)
Mutual labels:  raspberry-pi
Qdomyos Zwift
Zwift bridge for smart treadmills and bike/cyclette
Stars: ✭ 63 (-3.08%)
Mutual labels:  raspberry-pi
Magicmirror
let's make a magicMirror
Stars: ✭ 57 (-12.31%)
Mutual labels:  raspberry-pi
Gosdm630
An interface for the Eastron SDM/Modbus smart meter series.
Stars: ✭ 64 (-1.54%)
Mutual labels:  raspberry-pi
Tinypilot
Use your Raspberry Pi as a browser-based KVM.
Stars: ✭ 1,078 (+1558.46%)
Mutual labels:  raspberry-pi
Escapefromtarkov Trainer
Escape from Tarkov Trainer
Stars: ✭ 59 (-9.23%)
Mutual labels:  mono
Openvoiceos
OpenVoiceOS is a minimalistic linux OS bringing the open source voice assistant Mycroft A.I. to embbeded, low-spec headless and/or small (touch)screen devices.
Stars: ✭ 64 (-1.54%)
Mutual labels:  raspberry-pi
Rpizero smart camera3
Smart security camera with Raspberry Pi Zero and OpenFaaS
Stars: ✭ 58 (-10.77%)
Mutual labels:  raspberry-pi
Rpindvi
Raspberry PI NDVI Code
Stars: ✭ 57 (-12.31%)
Mutual labels:  raspberry-pi

RaspberryGPIOManager   raspberrypi.org

This simple C# library allows you to easily manage any GPIO pin on your Raspberry Pi. If you wish to learn more about GPIO, you may want to look at this. To see an example on how the library works, see below.


Notice: I'm currently performing major changes to the code and the repository. Sorry if I'll mess up and break some source files.

Compiling

If you're keeping your RPi setup as lightweight as possible and you're not using an IDE you can compile this library and your project as follows:

mcs -t:library GpioPin.cs Exceptions.cs -out:Raspberry-GPIO-Manager.dll

mcs -reference:"path/to/previous/generated.dll" yourProject.cs

GPIOPinDriver object

The GPIOPinDriver object is the one you need to build in order to perform any action. In its constructor you have to specify the GPIO pin to associate, and you may also want to give the direction and the initial value to assign.

var pin1 = new GPIOPinDriver(GPIOPinDriver.Pin.GPIO23);

var pin2 = new GPIOPinDriver(GPIOPinDriver.Pin.GPIO23, GPIOPinDriver.GPIODirection.Out, GPIOPinDriver.GPIOState.Low);

GPIOPinDriver properties

Once you have created your object(s), you can access following properties:

Direction - In or Out, (treat it as an input or output pin)

GPIOPin - [Readonly] The pin that is being controlled.

State - The current value of the signal. In output mode this property can be used to switch on or off the pin, in input mode to read the value of it (High/Low).

Coming Soon

  • Possibility to handle events on GPIO pin state changes
  • Object to handle serial communication

Notes

GPIOPinDriver class implements IDisposable interface, that is to say it should be disposed at the end, calling either Dispose() or Unexport() function.

IMPORTANT: Accessing GPIO pins require root permissions!


Raspberry Pi is a trademark of the Raspberry Pi Foundation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].