Unsolved not get GPIO pulse
-
hello everybody i try to
generatea GPIO pulse signal but i dont get any signal an oscilloscope.i use raspberryPi2 als controller
my code#define PIN RPI_BPLUS_GPIO_J8_11
if (!bcm2835_init())
{
qDebug() << "error during initialisation of library"
}
else{ bcm2835_gpio_fsel(PIN, BCM2835_GPIO_FSEL_OUTP) //set pin to output bcm2835_gpio_clr(PIN);// set pin to low { for(int i=0; i<5;i++)//5 perioden bcm2835_gpio_write(PIN, HIGH)// pin auf 1 bcm2835_delay(500); //wait 0.5s bcm2835_gpio_write(PIN, LOW);//pin auf 0 bcm2835_delay(500);//wait 0.5 }
}
-
Hi are you getting any error? And are you running the code as root? (sudo ./a.out) Try pasting your code. Examples from http://www.effusiontech.com/how-to-blink-led-in-raspberry-pi-using-c-language.html is working fine.