Example: Blinking led: Difference between revisions
Jump to navigation
Jump to search
Andreabont (talk | contribs) (Created page with "== Simple Example == <source lang="cpp"> #include <cstdio> #include <unistd.h> #include "miosix.h" using namespace std; using namespace miosix; typedef Gpio<GPIOC_BASE,7> l...") |
Andreabont (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
== Simple | === Simple blink === | ||
<source lang="cpp"> | <source lang="cpp"> | ||
#include <cstdio> | #include <cstdio> |
Revision as of 21:01, 13 April 2014
Simple blink
#include <cstdio>
#include <unistd.h>
#include "miosix.h"
using namespace std;
using namespace miosix;
typedef Gpio<GPIOC_BASE,7> led;
int main()
{
led::mode(Mode::OUTPUT);
for(;;) {
led::high();
sleep(1);
led::low();
sleep(1);
}
return 0;
}