Sebastian Gsellmann
/
Bertel_mit_Tasern
Bertel fährt mit Tastern
Revision 0:6732508afb31, committed 2016-06-06
- Comitter:
- Gsellmann_Sebastian
- Date:
- Mon Jun 06 10:37:05 2016 +0000
- Commit message:
- Bertel f?hrt mit Tastern
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 6732508afb31 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jun 06 10:37:05 2016 +0000 @@ -0,0 +1,130 @@ +#include "mbed.h" + +DigitalOut Von (P2_13); // Motor Spannung ab BERTL15 nötig ! +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 + +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); + +DigitalIn TA1 (P1_23); +DigitalIn TA2 (P1_24); +DigitalIn TA3 (P1_25); +DigitalIn TA4 (P1_26); +DigitalIn TA5 (P1_27); +DigitalIn TA6 (P1_28); +DigitalIn TA7 (P1_30); +DigitalIn TA8 (P1_31); + + + + + +DigitalOut LedD6 (P1_14); +DigitalOut LedD7 (P1_15); +DigitalOut LedD8 (P1_16); +DigitalOut LedD9 (P1_17); + + +int main() { // Start Hauptprogramm + Von=1; // Motor Spannung EIN + MotorR_EN=MotorL_EN=1; + + while(1) { + + if (TA8==1){ //ggf + MotorL_REVERSE=1; + MotorR_REVERSE=1; + LedD7 = 1; + LedD9 = 1; + + }else { + { + + LedD7 = 0; + LedD9 = 0; + MotorL_REVERSE=0; + MotorR_REVERSE=0; + MotorR_FORWARD=1; + MotorL_FORWARD=1; + wait(0.5); + MotorL_FORWARD=0; + wait(0.5); + MotorR_FORWARD=0; + MotorL_REVERSE=1; + MotorR_REVERSE=1; + }} + + if (TA3==1){ //ggf + MotorL_REVERSE=1; + MotorR_REVERSE=1; + LedD7 = 1; + LedD9 = 1; + + }else { + { + + LedD7 = 0; + LedD9 = 0; + MotorL_REVERSE=0; + MotorR_REVERSE=0; + MotorR_FORWARD=1; + MotorL_FORWARD=1; + wait(0.5); + MotorL_FORWARD=0; + wait(0.5); + MotorR_FORWARD=0; + MotorL_REVERSE=1; + MotorR_REVERSE=1; + }} + + if (TA7==1){ //ggf + MotorL_REVERSE=1; + MotorR_REVERSE=1; + LedD7 = 1; + LedD9 = 1; + + }else { + { + + LedD7 = 0; + LedD9 = 0; + MotorL_REVERSE=0; + MotorR_REVERSE=0; + MotorR_FORWARD=1; + MotorL_FORWARD=1; + wait(0.5); + MotorR_FORWARD=0; + wait(0.5); + MotorL_FORWARD=0; + MotorL_REVERSE=1; + MotorR_REVERSE=1; + }} + + if (TA2==1){ //ggf + MotorL_REVERSE=1; + MotorR_REVERSE=1; + LedD7 = 1; + LedD9 = 1; + + }else { + { + + LedD7 = 0; + LedD9 = 0; + MotorL_REVERSE=0; + MotorR_REVERSE=0; + MotorR_FORWARD=1; + MotorL_FORWARD=1; + wait(0.5); + MotorR_FORWARD=0; + wait(0.5); + MotorL_FORWARD=0; + MotorL_REVERSE=1; + MotorR_REVERSE=1; + }} + + +} } \ No newline at end of file
diff -r 000000000000 -r 6732508afb31 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Jun 06 10:37:05 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7c328cabac7e \ No newline at end of file