-
Notifications
You must be signed in to change notification settings - Fork 13
Using C
William Stevens edited this page Jul 16, 2018
·
2 revisions
This Wiki page details how to use C or C++ to control a Flipper board.
To use Flipper from Python you will need to install libflipper.
Navigate to the root of the repository and run the install command. If you already ran an install from the top level repository you can skip this step as libflipper will already be installed.
make install-libflipper
main.c
#include <flipper.h>
int main(int argc, char *argv[]) {
flipper_attach(); // Attach a Flipper board
led.rgb(0, 0, 10); // Turn the LED blue
return 0;
}and build
gcc -o main main.c -lflippermain.c
#include <flipper.h>
int main(int argc, char *argv[]) {
flipper_attach(); // Attach a Flipper board
gpio.enable(IO_4, 0); // Set IO4 as an output
gpio.write(IO_4, 0); // Set IO4 HIGH
return 0;
}and build
gcc -o main main.c -lflipper