Objective is to control the LED to on/off. I used the following code additions, with the appropriate additions to the .h file:
define LED 18 // GPIO pin 12
void LED_on(void) {
bcm2835_gpio_fsel(LED,BCM2835_GPIO_FSEL_OUTP); // LED
bcm2835_gpio_write(LED, HIGH);
}
void LED_off(void) {
bcm2835_gpio_fsel(LED,BCM2835_GPIO_FSEL_OUTP); // LED
bcm2835_gpio_write(LED, LOW);
}
Those changes compile successfully, along with the addition of the calls to turn the LED on at the start of the main segment in demo.c and at the end to turn the LED off. I plead guilty to little or no knowledge of the BCM2834, so I just used your existing code for the RES function. The result is now a segmentation fault with those changes in place, whereas it runs normally with the original code.
Objective is to control the LED to on/off. I used the following code additions, with the appropriate additions to the .h file:
define LED 18 // GPIO pin 12
void LED_on(void) { bcm2835_gpio_fsel(LED,BCM2835_GPIO_FSEL_OUTP); // LED bcm2835_gpio_write(LED, HIGH); }
void LED_off(void) { bcm2835_gpio_fsel(LED,BCM2835_GPIO_FSEL_OUTP); // LED bcm2835_gpio_write(LED, LOW); }
Those changes compile successfully, along with the addition of the calls to turn the LED on at the start of the main segment in demo.c and at the end to turn the LED off. I plead guilty to little or no knowledge of the BCM2834, so I just used your existing code for the RES function. The result is now a segmentation fault with those changes in place, whereas it runs normally with the original code.
Any suggestions??