Bar Graph Breakout Kit

Board connections

The board has 6 pins:
- CLR (not connected)
- CLK (Connected to SPI Clock; Netduino pin 13)
- LAT (Connected to SPI Chip Select; Any Netduino pin will do)
- SIN (Connected to SPI MISO; Netduino pin 11)
- GND (Connected to Ground)
- +5V (Connected to +5V)

Sample code in C#

// We got 4 74HC595's in a chain
Ic74hc595 IcChain = new Ic74hc595(SPI_Devices.SPI1, Pins.GPIO_PIN_D10, 4);

// Led loop back and forward
while (true)
{
    for (int Counter = 0; Counter < 30; ++Counter)
    {
        IcChain.Pins[Counter].Write(true);
        Thread.Sleep(50);
        IcChain.Pins[Counter].Write(false);
    }
    for (int Counter = 28; Counter > 0; --Counter)
    {
        IcChain.Pins[Counter].Write(true);
        Thread.Sleep(50);
        IcChain.Pins[Counter].Write(false);
    }
}

Sample code in VB

' We got 4 74HC595's in a chain
Dim IcChain As Ic74hc595 = New Ic74hc595(SPI_Devices.SPI1, Pins.GPIO_PIN_D10, 4)

' Led loop back and forward
Do
    For Counter = 0 To 29
        IcChain.Pins(Counter).Write(True)
        Thread.Sleep(50)
        IcChain.Pins(Counter).Write(False)
    Next
    For Counter = 28 To 1 Step -1
        IcChain.Pins(Counter).Write(True)
        Thread.Sleep(50)
        IcChain.Pins(Counter).Write(False)
    Next
Loop

Last edited Dec 29, 2012 at 6:37 AM by Garrcomm, version 3