Example: Blinking led

From Miosix Wiki
Revision as of 20:28, 12 April 2014 by 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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Simple Example

#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;
  
}