Browse Source

First test

master
Gerardo Marx 8 months ago
commit
a99f6b9c16
2 changed files with 23 additions and 0 deletions
  1. +1
    -0
      Readme.md
  2. +22
    -0
      main.c

+ 1
- 0
Readme.md View File

@ -0,0 +1 @@
gcc main.c -o main

+ 22
- 0
main.c View File

@ -0,0 +1,22 @@
#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;
}

Loading…
Cancel
Save