Basic example to use C for LED control on BBB
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
443 B

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define LED3P "/sys/class/leds/beaglebone:green:usr3"
int main() {
FILE* fp;
char fullFile[100];
//trigger non
sprintf(fullFile, LED3P "%s", "/trigger");
fp = fopen(fullFile, "w+");
fprintf(fp, "%s", "none");
fclose(fp);
// Led on
sprintf(fullFile, LED3P "%s", "/brightness");
fp = fopen(fullFile, "w+");
fprintf(fp, "%s", "1");
fclose(fp);
printf("Done\n");
return 0;
}