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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:646b6cf24af2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Mar 10 17:00:01 2017 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+#include "IRSensor.h"
+
+
+DigitalOut led0(PC_8);
+DigitalOut led1(PC_6);
+DigitalOut led2(PB_12);
+DigitalOut led3(PA_7);
+DigitalOut led4(PC_0);
+DigitalOut led5(PC_9);
+
+AnalogIn distance(PB_1); // Kreieren der Ein- und Ausgangsobjekte
+DigitalOut enable(PC_1);
+DigitalOut bit0(PH_1);
+DigitalOut bit1(PC_2);
+DigitalOut bit2(PC_3);
+
+DigitalOut enableMotorDriver(PB_2);
+DigitalIn motorDriverFault(PB_14);
+DigitalIn motorDriverWarning(PB_15);
+PwmOut pwmLeft(PA_8);
+PwmOut pwmRight(PA_9);
+
+
+DigitalOut myled(LED1);
+
+int main() {
+
+IRSensor irSensor0(distance, bit0, bit1, bit2, 0); // Objekte kreieren
+IRSensor irSensor1(distance, bit0, bit1, bit2, 1);
+IRSensor irSensor2(distance, bit0, bit1, bit2, 2);
+IRSensor irSensor3(distance, bit0, bit1, bit2, 3);
+IRSensor irSensor4(distance, bit0, bit1, bit2, 4);
+IRSensor irSensor5(distance, bit0, bit1, bit2, 5);
+enable = 1; // schaltet die Sensoren ein
+pwmLeft.period(0.00005); // Setzt die Periode auf 50 μs
+pwmRight.period(0.00005);
+pwmLeft = 0.7; // Setzt die Duty-Cycle auf 50%
+pwmRight = 0.7;
+enableMotorDriver = 1; // Schaltet den Leistungstreiber ein
+ while(1) {
+
+
+ }
+}