TINF_TwoLeds_Bsp1

Dependencies:   TwoLeds mbed

Revision:
1:ecc648c8da1c
Parent:
0:23f5cf9d9707
--- a/main.cpp	Mon Jun 18 13:16:35 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-#include "mbed.h"
-
-
-class TwoLeds {
-public:
-    TwoLeds(PinName pin1, PinName pin2) : _pin1(pin1), _pin2(pin2) {     // Initialisierungsliste
-    _pin1 = 0;                            // Initialisierung mit 0
-    _pin2 = 0;
-}
-
-void ledOn(void) {
-    _pin1 = 1;
-    _pin2 = 1;
-}
-
-void ledOff(void) {
-    _pin1 = 0;
-    _pin2 = 0;
-}
-
-void ledX() {
-    if( _pin1 == 0 && _pin2 == 0){
-        _pin1 = 1;
-        _pin2 = 0;
-    }
-    else if(_pin1 == 1 && _pin2 == 0){
-        _pin1 = 0;
-        _pin2 = 1;
-    }
-    else if(_pin1 == 0 && _pin2 == 1){
-        _pin1 = 1;
-        _pin2 = 0;
-    }
-
-}
-
-void printStatus(void) {
-    printf("LED1 is now: %d\n", _pin1.read());
-    printf("LED2 is now: %d\n", _pin2.read());
-}
-    
-private:
-    DigitalOut _pin1;
-    DigitalOut _pin2;
-    
-};
-
-
-DigitalOut led(LED1);
-// MyLed myled2(LED2);                 // Instanziierung des Objektes
-// MyLed myled5(p5);
-
-TwoLeds twoleds(LED1, LED2);
-
-int main() {
-    while (1) {
-        /*twoleds.ledOn();             // Zugriff auf die Methode über "."-Operator
-        twoleds.printStatus();
-        wait_ms(500);
-        twoleds.ledOff();            // Zugriff auf die Methode über "."-Operator
-        twoleds.printStatus();
-        wait_ms(500); */
-        twoleds.ledX();
-        twoleds.printStatus();
-        wait_ms(500);
-        
-
-    }
-}
\ No newline at end of file