Example: Blinking led

From Miosix Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Simple blink

This example file can be found in miosix/_examples/blinking_led/simple.cpp

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