Lehrer Busch
/
110_robot_H_Bridge8835_UserButton_DIR_PWM
110_robot_H_Bridge8835_UserButton_DIR_PWM
Diff: main.cpp
- Revision:
- 1:2849454dd0ab
- Parent:
- 0:f53860730a45
- Child:
- 2:5d1d6ad41669
--- a/main.cpp Mon Jan 31 16:59:51 2022 +0000 +++ b/main.cpp Fri Feb 04 14:43:31 2022 +0000 @@ -1,9 +1,8 @@ -/* mbed BuschA - */ +/* mbed BuschA*/ #include "mbed.h" -DigitalIn CableSwitch(D2); //PullUp auf Board, PA_10 +DigitalIn User_Button(PC_13); //PullUp auf Board, PC13 PwmOut M1_PWM(D9); DigitalOut M1_DIR(D7); @@ -13,14 +12,14 @@ M1_PWM.period_ms(10); // PWM-Periode while (1) { - if (CableSwitch == false) + if (User_Button == false) { M1_DIR = 1; M1_PWM = 0.5; //Tastgrad 0-1 } else { - M1_DIR = 1; + M1_DIR = 0; M1_PWM = 0.95; } }