#include #include #include #include using namespace std; // which GPIO17 #define PIN_01 RPI_GPIO_P1_11 // which GPIO4 #define PIN_02 RPI_GPIO_P1_07 int main(int, char**) { cout << "starting service..." << endl; // bcm2835_set_debug(1); if (!bcm2835_init()) { return 1; } bcm2835_gpio_fsel( PIN_02, BCM2835_GPIO_FSEL_OUTP); int t = 0; while (t++ < 1000) { usleep(50000L); bcm2835_gpio_write( PIN_02, HIGH); cout << "HIGH" << endl; usleep(50000L); bcm2835_gpio_write( PIN_02, LOW); cout << "LOW" << endl; } bcm2835_close(); return 0; }