projet neotim mpp / Mbed 2 deprecated projetv2

Dependencies:   mbed

main.cpp

Committer:
jdeschamps
Date:
2020-05-04
Revision:
1:8e1033a40696
Parent:
0:b5c75bc6000e
Child:
2:53d8e05db3d9

File content as of revision 1:8e1033a40696:

#include "mbed.h"

Serial pc(USBTX, USBRX,9600); // tx, rx sur les broches associées au bus USB
DigitalOut led1(LED1);
DigitalOut brka (PTC4);
DigitalOut brkb (PTC12);
DigitalOut dira (PTD3);
DigitalOut dirb (PTD1);

Ticker mon_IT; // on associe l'interface Timeout à l'objet mon_IT

void Interruption_timer() {
    printf("coucou\n");
    led1=!led1;
    
    }

int main(void)
{
    mon_IT.attach(&Interruption_timer,0.5); // l'interruption est associée au programme Interruption_timer et s'exécute toutes les 0.5s
                                            // pour stopper mon_IT.detach();
    while(1)
    {        
    }
}