RPICSIO
A C# I/O Library for the Raspberry Pi

Example Code

 

Example Code

Sample code illustrating the use of each of the main classes in the RPICSIO library. The source code for all classes in the RPICSIO library are available online for download and also in browseable form.

How to use the I2CPort Class
Examples demonstrating the use of the I2CPortFS class to write to and read from the I2C ports on the Raspberry Pi.

How to use the InputPort Classes
Examples demonstrating the use of the InputPortFS and InputPortMM classes to read the state (high or low) of a GPIO pin on the Raspberry Pi.

How to use the InterruptPort Class
Examples demonstrating the use of the InterruptPortMM class to trigger a .NET event on a state change (high or low) of a GPIO pin on the Raspberry Pi.

How to use the OutputPort Classes
Examples demonstrating the use of the OutputPortFS and OutputPortMM classes to set the state (high or low) of a GPIO pin on the Raspberry Pi.

How to use the PWMPort Class
Examples demonstrating how to use the PWMPort class to enable a PWM output, set its fundamental frequency and adjust the duty cycle.

How to use the SerialPort Class
Examples demonstrating the use of the SerialPortFS class to write to and read from the serial ports on the Raspberry Pi.

How to use the SPIPort Class
Examples demonstrating the use of the SPIPortFS class to write to and read from the SPI ports on the Raspberry Pi.