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: A1_Lekt2_LaufShift_Bitmanipulation.cpp
- Revision:
- 0:56207c59a56d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/A1_Lekt2_LaufShift_Bitmanipulation.cpp Sun Jan 12 22:33:32 2020 +0000
@@ -0,0 +1,30 @@
+/*
+0. Aufgabe: [LaufShift]] Programmiere ein Lauflicht für die
+vier blauen Leds mit BusOut und Verschiebe Operatoren.
+*/
+
+#include "mbed.h"
+
+//BusOut leds(D0,D3,D6,D9,D11,D12,A1,A5);
+BusOut leds(D0,D3,D6,D9);
+
+void laufshift();
+int main()
+{
+
+ while(1)
+ {
+ laufshift();
+ }
+}
+
+void laufshift()
+{
+ leds=1;
+ wait_ms(250);
+ for(int i=1;i<5;i++)
+ {
+ leds=leds<<1;
+ wait_ms(250);
+ }
+}
\ No newline at end of file