hallo
Dependencies: mbed
Revision 0:5664d8473933, committed 2016-05-25
- Comitter:
- benjaminmoerth
- Date:
- Wed May 25 08:48:23 2016 +0000
- Commit message:
- Geschwindigkeitseinstellung
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 5664d8473933 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed May 25 08:48:23 2016 +0000 @@ -0,0 +1,78 @@ +#include "mbed.h" + +DigitalOut LedD1 (P1_10); +DigitalOut LedD2 (P1_11); +DigitalOut LedD4 (P1_12); +DigitalOut LedD5 (P1_13); +DigitalOut LedD6 (P1_14); +DigitalOut LedD7 (P1_15); +DigitalOut LedD8 (P1_16); +DigitalOut LedD9 (P1_17); +DigitalOut LedD10 (P1_18); +DigitalOut LedD11 (P2_16); +DigitalOut LedD12 (P1_20); +DigitalOut LedD13 (P1_21); + + +DigitalOut Von (P2_13); // Motor Spannung ab BERTL15 nötig ! + +PwmOut MotorL (P1_19); +DigitalOut MotorL_EN(P1_19); // Enable OB DIE LINKS ODER RECHTS IST NOCH NICHT KLAR ! +DigitalOut MotorL_FORWARD(P2_14); // Forwerts +DigitalOut MotorL_REVERSE(P2_15); // Rückwerts + +PwmOut MotorR (P2_19); +DigitalOut MotorR_EN(P2_19); //Die Leitung führt zum Pin PO_21 am Prozessor +DigitalOut MotorR_FORWARD(P2_21); //Die Leitung führt zum Pin P1_3 am Prozessor +DigitalOut MotorR_REVERSE(P2_20); + +int main() + { + Von=1; + // Motor Spannung EIN + + + + MotorL_EN = 0.5f; + + + MotorR_EN = 1.0f; + + + + // Beide Motoren ENABLE + LedD1=LedD2=LedD4=LedD5=LedD6=LedD7=LedD8=LedD9=LedD10=LedD11=LedD12=LedD13=1; + MotorL_FORWARD = MotorR_FORWARD= 1; + wait (1); + MotorL_FORWARD = MotorR_FORWARD= 0; + while(1) + { + LedD1=LedD2=LedD4=LedD5=LedD6=LedD7=LedD8=LedD9=LedD10=LedD11=LedD12=LedD13=0; + wait (1); + LedD1=LedD2=LedD4=LedD5=LedD6=LedD7=LedD8=LedD9=LedD10=LedD11=LedD12=LedD13=1; + wait (1), + LedD1=LedD2=LedD4=LedD5=LedD6=LedD7=LedD8=LedD9=LedD10=LedD11=LedD12=LedD13=0; + wait(1); + LedD1=LedD2=LedD4=LedD5=LedD6=LedD7=LedD8=LedD9=LedD10=LedD11=LedD12=LedD13=1; + + MotorL_REVERSE= MotorR_REVERSE= 1; + wait(2); + MotorL_REVERSE= MotorR_REVERSE= 0; + + LedD1=LedD2=LedD4=LedD5=LedD6=LedD7=LedD8=LedD9=LedD10=LedD11=LedD12=LedD13=0; + wait (1); + LedD1=LedD2=LedD4=LedD5=LedD6=LedD7=LedD8=LedD9=LedD10=LedD11=LedD12=LedD13=1; + wait (1), + LedD1=LedD2=LedD4=LedD5=LedD6=LedD7=LedD8=LedD9=LedD10=LedD11=LedD12=LedD13=0; + wait(1); + LedD1=LedD2=LedD4=LedD5=LedD6=LedD7=LedD8=LedD9=LedD10=LedD11=LedD12=LedD13=1; + + MotorL_FORWARD = MotorR_FORWARD= 1; + wait (2); + MotorL_FORWARD = MotorR_FORWARD= 0; + + + + + } +}
diff -r 000000000000 -r 5664d8473933 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed May 25 08:48:23 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7c328cabac7e \ No newline at end of file