Git Product home page Git Product logo

pifacesharp's Introduction

PiFaceSharp

PiFaceSharp is a C# library for controlling the inputs and outputs on a Pi-Face Digital device connected to a Raspberry Pi, and is based loosely around Gordon Henderson's WiringPiFace project (see https://projects.drogon.net/raspberry-pi/wiringpiface/).

The library can be used to write C# applications that run using Mono on the Raspberry Pi.

Follow the links below to read about some of the features of PiFaceSharp:

  • Getting Started

  • Pin Controllers - background workers that will manage pin state automatically

  • PiFace Emulator - a virtual PiFace for Windows that you can program against even if you don't have a Raspberry Pi!

  • PiFace Remoting - control the pins on your PiFace over a network using exactly the same C# code as when running it on the Raspberry Pi.

Example

// get reference to default piface device
var piface = new PiFaceDevice();

// toggle each output pin on and off 50 times
for (byte pin = 0; pin < 8; pin++)
{
    var state = true;
    for (var i = 0; i < 50; i++)
    {
        piface.SetOutputPinState(pin, state);
        System.Threading.Thread.Sleep(25);
        state = !state;
    }
}

// read the current state of each input pin
for (byte pin = 0; pin < 8; pin++)
{
    Console.Write(piface.GetInputPinState(pin) + " ");
}

See the Kingsland.PiFaceSharp.SampleConsole project for the full source.

License

This project is licensed under the GNU Lesser General Public License (LGPL) v3. See LICENSE.txt for details.

pifacesharp's People

Contributors

mikeclayton avatar

Watchers

James Cloos avatar Taewoo Kim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.