32 lines
576 B
C
32 lines
576 B
C
/*
|
|
* sr.c:
|
|
* Shift register test program
|
|
*
|
|
* Copyright (c) 2012-2013 Gordon Henderson. <projects@drogon.net>
|
|
***********************************************************************
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <wiringPi.h>
|
|
#include <sr595.h>
|
|
|
|
int main (void)
|
|
{
|
|
// int i, bit;
|
|
|
|
wiringPiSetup ();
|
|
|
|
// Pin base 100 for 10 pins.
|
|
// Use wiringPi pins 0, 1 & 2 for data, clock and latch
|
|
sr595Setup (100, 8, 2, 3, 0);
|
|
|
|
printf ("Raspberry Pi - Shift Register Test\n");
|
|
|
|
for (;;) {
|
|
digitalWrite (106, 1);
|
|
digitalWrite(104, 1);
|
|
}
|
|
return 0;
|
|
|
|
}
|