Last active
August 29, 2015 13:57
-
-
Save hsiboy/9395789 to your computer and use it in GitHub Desktop.
Raspberry Pi - BCM2835 - Getting to blinky - Perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# need to run as root. | |
# flashes an led connected to GPIO 11 aka PIN 17 | |
use strict; | |
use warnings; | |
use Device::BCM2835; | |
Device::BCM2835::init() || die "Could not init library"; | |
Device::BCM2835::gpio_fsel( &Device::BCM2835::RPI_GPIO_P1_11, | |
&Device::BCM2835::BCM2835_GPIO_FSEL_OUTP); | |
while( 1 ){ | |
Device::BCM2835::gpio_write(&Device::BCM2835::RPI_GPIO_P1_11, 1); | |
Device::BCM2835::delay(500); | |
Device::BCM2835::gpio_write(&Device::BCM2835::RPI_GPIO_P1_11, 0); | |
Device::BCM2835::delay(500); | |
} | |
exit( 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment