Windows 10 IoT – Raspberry PI 2

Finaly I received my Raspberry PI 2, just in time to make some tests with Windows 10 IoT (Internet of Things).

Microsoft released Windows 10 IoT that can be installed in Raspberry PI 2 and allow us to develop in CSharp (for example) with full access to sensors and devices.

This post is just to show how easy it is to program in CSharp a simple class to access a 7 Segment led using Raspberry.

7segmentos2

I developed a couple of years ago a library for accessing 7 Segment leds in arduino. Now in a few minutes, I migrated the library to CSharp and used it in Raspberry.

First this image show how I have wired the 7 Segment led to the Raspberry PI:

7SegRaspb

Wiring

7segmentos5

Rasp7Seg


Raspberry 7Segment
Pin #01 (3.3v) Vcc
GPIO 16 (Pin #23) a
GPIO 12 (Pin #25) b
GPIO 5 (Pin #15) c
GPIO 6 (Pin #16) d
GPIO 0 (Pin #14) e
GPIO 1 (Pin #27) f
GPIO 24 (Pin #32) g
GPIO 26 (Pin #19) dp

In visual studio 2015 I created a Windows IoT core (Background Application). Now just added the class that handles 7 segment communication and used the methods in main class

The class is very simple, just create it passing all pin numbers and if it is a common anode or common catode. Later, at any time change the value of property CurrentValue and the number in the display will change accordingly.

The  StartupTask:

You can dowload the class in GitHub and the a full sample project here LM7Seg