Einfaches Lauflicht

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 ///////////////////////
00002 //  Lauflicht        //
00003 //  NUCLEO-L432KC    //
00004 //  Stefan Simbürger //
00005 //  08.01.2020       //
00006 ///////////////////////
00007 
00008 #include "mbed.h"
00009 
00010 BusOut leds(D11, D10, D9, D6, D5, D4, D3, D2);
00011 
00012 void runLight();
00013 
00014 int main() {
00015     while(1) {
00016         runLight();
00017     }
00018 }
00019 
00020 void runLight(){
00021     leds = 0x01;
00022     for(int i = 0; i < 8; i++)
00023     {
00024         wait_ms(200);
00025         leds = leds << 1;
00026     }
00027 }