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: main.cpp
- Revision:
- 1:8b600c187fe6
- Parent:
- 0:c88f41ac2cb7
- Child:
- 2:f381fc3a8eaf
--- a/main.cpp Wed Feb 26 12:29:10 2020 +0000
+++ b/main.cpp Wed Feb 26 12:49:12 2020 +0000
@@ -17,6 +17,11 @@
DigitalOut led4(PD_7);
DigitalOut led5(PD_5);
+DigitalOut en_Motor(PG_0);
+DigitalIn Error_Motor(PD_1);
+DigitalIn Warn_Motor(PD_0);
+PWMOut MotorLeft(PF_9);
+PWMOut MotorRight(PF_8);
IRSensor S_hinten(v_distance, bit0 , bit1, bit2, 0);
@@ -27,7 +32,19 @@
IRSensor S_hinten_rechts(v_distance, bit0 , bit1, bit2, 5);
int main() {
+ //Set Motor Settings
+ MotorLeft.period(0.00005);
+ MotorRight.period(0.00005);
+
+ MotorLeft = 0.5;
+ MotorRight = 0.5;
+
+ en_Motor = 1;
+
+ //Set IR Setting
enable = 1;
+
+
while(1) {
float distance0 = S_hinten.read(); // gibt die Distanz in [m] zurueck
float distance1 = S_hinten_links.read();