Abgabe PE

Dependents:   TINF_mbedSimulator_2Leds

Committer:
martwerl
Date:
Thu Nov 15 18:18:02 2018 +0000
Revision:
1:980633ae6573
Parent:
0:a68f8dc747e7
2Leds

Who changed what in which revision?

UserRevisionLine numberNew contents of line
martwerl 0:a68f8dc747e7 1 #include "mbed.h"
martwerl 1:980633ae6573 2 #ifndef TWOLEDS_H
martwerl 1:980633ae6573 3 #define TWOLEDS_H
martwerl 0:a68f8dc747e7 4
martwerl 0:a68f8dc747e7 5 class TwoLeds
martwerl 0:a68f8dc747e7 6 {
martwerl 0:a68f8dc747e7 7 public:
martwerl 0:a68f8dc747e7 8 TwoLeds(PinName pin1, PinName pin2) : _pin1(pin1), _pin2(pin2) // Initialisierungsliste
martwerl 0:a68f8dc747e7 9 {
martwerl 0:a68f8dc747e7 10 _pin1 = 0;
martwerl 0:a68f8dc747e7 11 _pin2 = 0;
martwerl 0:a68f8dc747e7 12 }
martwerl 0:a68f8dc747e7 13 void ledOn(void) {
martwerl 0:a68f8dc747e7 14 }
martwerl 0:a68f8dc747e7 15
martwerl 0:a68f8dc747e7 16 void ledOff(void) {
martwerl 0:a68f8dc747e7 17 }
martwerl 0:a68f8dc747e7 18
martwerl 0:a68f8dc747e7 19 void ledX(){ //LEDs blinken alternierend
martwerl 0:a68f8dc747e7 20 }
martwerl 0:a68f8dc747e7 21
martwerl 0:a68f8dc747e7 22 void printStatus(void)
martwerl 0:a68f8dc747e7 23 {
martwerl 1:980633ae6573 24 /* printf("LED1 ist jetzt: %d\n", _pin1.read());
martwerl 1:980633ae6573 25 printf("LED2 ist jetzt: %d\n", _pin2.read());*/
martwerl 0:a68f8dc747e7 26 }
martwerl 0:a68f8dc747e7 27
martwerl 0:a68f8dc747e7 28 private:
martwerl 0:a68f8dc747e7 29 DigitalOut _pin1;
martwerl 0:a68f8dc747e7 30 DigitalOut _pin2;
martwerl 0:a68f8dc747e7 31
martwerl 0:a68f8dc747e7 32 };
martwerl 0:a68f8dc747e7 33 #endif