test

Files at this revision

API Documentation at this revision

Comitter:
itbusch
Date:
Mon Jan 31 06:59:34 2022 +0000
Parent:
0:05bee2dd672d
Commit message:
020_LED_blink_wait_oszi

Changed in this revision

Warten.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
wait.h Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Warten.h	Mon Jan 31 06:59:34 2022 +0000
@@ -0,0 +1,11 @@
+
+ int a;                                 //WICHTIG: Deklarieren HIER!
+
+void Warten (void)                      //UP: Warten...
+{
+    for (int i = 0; i < 1000000; i++)   //ANNAHME: 1Takt = MZ: 32MhZ/32 MZ? => 1 ns * 10000000 => 1ms
+    {                                   // => tatsächluche Messung ~240 ms => 240*länger => Zyklen??... 
+             a = !a;                    // bei declaration Datentyp HIER => Compiler optmiert RAUS!
+    }
+}
+    
\ No newline at end of file
--- a/main.cpp	Mon Jan 24 07:37:38 2022 +0000
+++ b/main.cpp	Mon Jan 31 06:59:34 2022 +0000
@@ -1,22 +1,21 @@
-/* mbed BuschA
- */
+/* mbed BuschA */
 
 #include "mbed.h"
-#include "wait.h"
+#include "Warten.h"
 
 //Initialisiere Ausgangspin und Variable
 DigitalOut Boardled(LED1);
-//DigitalOut Oszi(D3);
+DigitalOut Oszi(D3);                //Oszi-Pin zur Zeitmessung
 
-int main()
+int main()                          
 {
     while (true) 
     {
         Boardled = 1;
-        //Oszi = 1;
-        wait();                 //Warten
-        Boardled = 0;
-        //Oszi = 0;
-        wait();
+        Oszi = 1;                   //Oszi-Hilfs-Bit = HIGH
+        Warten();                   //UP-Aufruf: Warten
+        Boardled = 0;   
+        Oszi = 0;                   //Oszi-Hilfs-Bit = LOW
+        Warten();                   //UP-Aufruf: Warten
     }
 }
\ No newline at end of file
--- a/mbed-os.lib	Mon Jan 24 07:37:38 2022 +0000
+++ b/mbed-os.lib	Mon Jan 31 06:59:34 2022 +0000
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os/#cf4f12a123c05fcae83fc56d76442015cb8a39e9
+https://github.com/ARMmbed/mbed-os/#b1796dedeb8accde1cbaecf136fab96895e23d81
--- a/wait.h	Mon Jan 24 07:37:38 2022 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-DigitalOut Oszi(D3);
-void wait (void)
-{
-    Oszi = 1;
-    for (int16_t i=0; i<= 5; i++)
-    {
-        for (int16_t x=0; x<= 5; x++)
-        {
-            for (int16_t y=0; y<= 5; y++)
-            {
-            int a = a;
-            }
-        }
-    }
-    Oszi = 0;
-}
-    
\ No newline at end of file