Stefan Simbürger / Mbed 2 deprecated Test_13012020

Dependencies:   mbed

Revision:
6:7dc8014c6ed6
Parent:
5:9df9f5f6fa57
diff -r 9df9f5f6fa57 -r 7dc8014c6ed6 main.cpp
--- a/main.cpp	Mon Jan 13 18:09:51 2020 +0000
+++ b/main.cpp	Mon Jan 13 18:11:38 2020 +0000
@@ -1,12 +1,12 @@
 #include "mbed.h"
-#define Button1 p14
+//#define Button1 p14
 
 void nibbleLeds(int value);
 int lauflicht(bool richtung, int time, int&anz);
 void printb(uint8_t);
 int modifyBit(int x, unsigned char position, bool State);
 BusOut myleds(LED1, LED2, LED3, LED4);
-//DigitalIn button(BUTTON1);
+DigitalIn button(BUTTON1);
 
 const int INIT = 0x03;
 
@@ -18,7 +18,6 @@
     printf("anzahl= %d\n", anzahl);
     nibbleLeds(value);
     printb(value);
-    value = modifyBit(value, 2, 1);
     printb(myleds);
     printb(modifyBit(INIT, 3, 1));
     wait(0.1);
@@ -67,6 +66,5 @@
 int modifyBit(int x, uint8_t position, bool State)
 {
     int mask = 1 << position;
-    int state = int(State);
-    return (x& ~mask) | ((state << position) & mask);
-}
\ No newline at end of file
+    return x | mask;
+}    
\ No newline at end of file