Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 6:7dc8014c6ed6
- Parent:
- 5:9df9f5f6fa57
--- 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