Reading GPIO values on the Raspberry Pi in C#

So, after some distraction due to fiddling with H2D2 and reading my new book on programming TCP/IP sockets :-) I've finally gotten round to testing the getting of GPIO values in C# on my Raspberry Pi with the help of the libpigpio shared C library which I slapped together. Also, in the meantime I've tested out libpigpio on Debian Wheezy which seems fine.

I'm happy to report that it seems to work great, here is the C# test program I used:

using System;
using System.Threading;
using LibPiGpio;
namespace RPiBlinky
    class Program
        static void Main(string[] args)
            RpiGpio.SetOutputPins(new[] { 7 });
            RpiGpio.SetInputPins(new[] { 17 });
            while (!Console.KeyAvailable)
                RpiGpio.Pins[7] = RpiGpio.Pins[17];

....which sets the value of one GPIO based on the value of another. I hooked up a button and an LED like I did before, so pressing the button makes the LED come on. That code makes it look pretty easy doesn't it?

Anyway, the next thing is to expose this stuff to a browser, so that GPIO values can be read/written over the internet. I'm working on that... I just need to tear myself away from TCP/IP sockets and programming language design long enough.

The arrival of my very own Raspberry Pi

A few weeks back my own Raspberry Pi arrived, so I thought that I should post a couple of photos to mark the occasion:

But I've been so busy recently that I haven't gotten round to posting them. So ... the Raspberry Pi that I borrowed has now returned to its rightful owner, and now I can continue experimenting on my own machine.