S5 / Mbed 2 deprecated APP2-Examen

Dependencies:   mbed-rtos mbed

main.cpp

Committer:
JosephMarinier
Date:
2017-02-03
Revision:
0:e581bdd1b2a6
Child:
1:a47e9e7852fd

File content as of revision 0:e581bdd1b2a6:

#include "mbed.h"

DigitalOut myled(LED1);
BusOut leds(LED4, LED3, LED2, LED1);

Ticker ticker;

#define periode 16
unsigned short out[period] = {0};

unsigned short t = 0;

void tick() {
    leds = i;
    t = (t + 1) % period;
}

int main() {
    leds = 0b0000;
    ticker.attach(&tick, 0.01);
}

//https://docs.mbed.com/docs/mbed-os-api-reference/en/5.3/APIs/tasks/rtos/

//Semaphore(count)
//int32_t wait(millisec)
//osStatus release()

//Mutex();
//osStatus lock();
//bool trylock();
//osStatus unlock();