120_robot_H_Bridge8835_UserButton_DIR_PWM_I2C_LCD

Dependencies:   LCD_i2C_JDS

Revision:
0:3ace550537fc
Child:
1:821dba977886
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jan 31 17:02:41 2022 +0000
@@ -0,0 +1,32 @@
+/* mbed BuschA,   */ 
+#include "mbed.h"
+#include "LCD.h"
+#include "LCD_Bua.h"
+// Set the LCD address to 0x27 for a 16 chars and 2 line display
+
+DigitalIn CableSwitch(D2); //PullUp auf Board, PA_10
+
+
+int main()
+{
+    mylcd.clear();               // LCD löschen
+    M1_PWM.period_ms(10);        // PWM-Periode
+    
+    while (true) 
+    {
+    if (CableSwitch == false)
+        {
+        M1_DIR = 1;
+        M1_PWM = 0.5;           //Tastgrad 0-1 
+        }
+    else
+        {
+        M1_DIR = 1;
+        M1_PWM = 0.95;
+        }
+    Ausgabe_LCD();
+    thread_sleep_for(1000); //Sleep = Warten... 
+    }
+}
+
+