Exemple Entrées/Sorties (I/O) NBoard

Dependencies:   mbed

Fork of NBoard_IO by NBoard

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers NBoard_IO.cpp Source File

NBoard_IO.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut Led0(PB_3);      // PB_3 port sur lequel est connecté la Led0
00004 BusOut MonBus(PA_7,PA_6);   // creation bus 
00005 DigitalIn BP0(PA_9,PullUp); //PA_9 port sur lequel est connecté le BP0
00006 //
00007 int main() {
00008     while(1) {
00009         Led0 = 1;   // Led0 is ON
00010         wait(0.2);  // 200 ms
00011         Led0 = 0;   // Led0 is OFF
00012         wait(0.2);  // 200 ms
00013         if(!BP0) MonBus=1;
00014         else MonBus=2;
00015     }
00016 }