Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bcm2835.h>
- #define IO_PIN RPI_GPIO_P1_11
- #define LATCH_PIN RPI_GPIO_P1_13
- #define CLOCK_PIN RPI_GPIO_P1_15
- int main(int argc, char **argv)
- {
- if (!bcm2835_init())
- return 1;
- bcm2835_gpio_fsel(IO_PIN, BCM2835_GPIO_FSEL_OUTP);
- bcm2835_gpio_fsel(LATCH_PIN, BCM2835_GPIO_FSEL_OUTP);
- bcm2835_gpio_fsel(CLOCK_PIN, BCM2835_GPIO_FSEL_OUTP);
- bcm2835_gpio_write(IO_PIN, HIGH);
- bcm2835_gpio_write(CLOCK_PIN, HIGH);
- delay(5);
- bcm2835_gpio_write(CLOCK_PIN, LOW);
- delay(5);
- bcm2835_gpio_write(CLOCK_PIN, HIGH);
- delay(5);
- bcm2835_gpio_write(CLOCK_PIN, LOW);
- delay(5);
- bcm2835_gpio_write(CLOCK_PIN, HIGH);
- delay(5);
- bcm2835_gpio_write(CLOCK_PIN, LOW);
- delay(5);
- bcm2835_gpio_write(LATCH_PIN, HIGH);
- bcm2835_gpio_write(LATCH_PIN, LOW);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement