Dependencies:   mbed

Committer:
martwerl
Date:
Thu Nov 15 18:00:07 2018 +0000
Revision:
0:daa949d07b7d
LED1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
martwerl 0:daa949d07b7d 1 #include "mbed.h"
martwerl 0:daa949d07b7d 2
martwerl 0:daa949d07b7d 3 //Das Digital Out Objekt L1 mit dem Pin LED1 verbinden
martwerl 0:daa949d07b7d 4 //D20 Variablenname P1_13 Pinname aus dem Schaltplan
martwerl 0:daa949d07b7d 5 //warum ist es sinnvol, dass die Variablen d20,d19,... heißen?
martwerl 0:daa949d07b7d 6 //Zusammenhang der untenstehenden Deklarationen mit der Boardbeschreibung {Script M0}
martwerl 0:daa949d07b7d 7 DigitalOut d20(P1_13);
martwerl 0:daa949d07b7d 8 DigitalOut d19(P1_12);
martwerl 0:daa949d07b7d 9 DigitalOut d18(P1_7);
martwerl 0:daa949d07b7d 10 DigitalOut d17(P1_6);
martwerl 0:daa949d07b7d 11
martwerl 0:daa949d07b7d 12 void SimpleRunLight();
martwerl 0:daa949d07b7d 13
martwerl 0:daa949d07b7d 14 int main() {
martwerl 0:daa949d07b7d 15 SimpleRunLight();
martwerl 0:daa949d07b7d 16 }
martwerl 0:daa949d07b7d 17
martwerl 0:daa949d07b7d 18
martwerl 0:daa949d07b7d 19 void SimpleRunLight()
martwerl 0:daa949d07b7d 20 {
martwerl 0:daa949d07b7d 21 d20=0; d19=0; d18=0; d17=0;
martwerl 0:daa949d07b7d 22 while(1)
martwerl 0:daa949d07b7d 23 {
martwerl 0:daa949d07b7d 24 d20=1; wait_ms(100);
martwerl 0:daa949d07b7d 25 d20=0; wait_ms(100);
martwerl 0:daa949d07b7d 26 d19=1; wait_ms(100);
martwerl 0:daa949d07b7d 27 d19=0; wait_ms(100);
martwerl 0:daa949d07b7d 28 d18=1; wait_ms(100);
martwerl 0:daa949d07b7d 29 d18=0; wait_ms(100);
martwerl 0:daa949d07b7d 30 d17=1; wait_ms(100);
martwerl 0:daa949d07b7d 31 d17=0; wait_ms(100);
martwerl 0:daa949d07b7d 32 }
martwerl 0:daa949d07b7d 33 }