Private
Public Access
2
0

gpio: Add cpp example to use IO.

* Patch direction setting

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2014-04-11 17:57:53 +01:00
parent 6bf02cf25e
commit 40438d709a
2 changed files with 29 additions and 8 deletions

20
examples/blink-io8.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include "stdio.h"
#include "maa.h"
int
main(int argc, char **argv)
{
fprintf(stdout, "MAA Version: %d\n Starting Blinking on IO8", get_version());
gpio_t gpio;
gpio_init(&gpio, 26);
gpio_dir(&gpio, "out");
while(1){
gpio_write(&gpio, 0);
sleep(1);
gpio_write(&gpio, 1);
sleep(1);
}
return 0;
}