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: E6__FAIL_Lekt1_Bankomat_Digitalio.cpp
- Revision:
- 0:b4e3ba4a7bd3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/E6__FAIL_Lekt1_Bankomat_Digitalio.cpp Sun Jan 12 21:58:09 2020 +0000
@@ -0,0 +1,45 @@
+/*
+6. [Bankomat] Erzeuge eine Bankomat Nachahmung mit folgenden Funktionen:
+
+random() // erzeugen eines zufälligen 4-stelligen Pins
+showPin() // zeigt den Pin-Code an den Leds an
+int checkPin() // Überprüft eine Eingabe mit dem Pin und gibt 1 zurück wenn gleich, sonst 0
+
+*/
+#include "mbed.h"
+
+//BusOut leds(D0,D3,D6,D9,D11,D12,A1,A5);
+BusOut leds(D0,D3,D6,D9);
+
+int random();
+void showpin();
+int checkpin(int wert);
+
+int main()
+{
+
+ while(1)
+ {
+
+ random();
+
+
+ }
+}
+
+int random()
+{
+
+
+ int a=0;
+ int e=1;
+ double r = e - a + 1;
+ printf("%d, %d\n",a,e);
+ return a + (int)(r * rand()/(RAND_MAX+1.0));
+
+
+
+
+
+
+}
\ No newline at end of file