Motorentest je 1 sec vorwärts

Dependencies:   mbed

Fork of _B14Test3 by BULME_BERTL14

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /***********************************
00002 name:   BERTL_2014_MOTOR_TEST
00003 author: Gottfried Enenkel   HTL BULME
00004 email:  ene@bulme.at
00005 description:
00006     Der BERTL fährt 1 sec lang  VORWÄRTS! 
00007     Danach steht er für 1 sec
00008     
00009     Wenn der Motor richtig eingebaut ist, 
00010     steht über dem Linken Anschluß ein PLUS
00011     Wenn sich der BERTL dreht, ist ein Motor verkehrt eingebaut. 
00012     
00013 ***********************************/
00014 #include "mbed.h"
00015 
00016 // ************ DEKLARATIONEN **************
00017 DigitalOut MotorL_EN(P1_15);         
00018 DigitalOut MotorL_FORWARD(P1_1);   
00019 DigitalOut MotorL_REVERSE(P1_0);   
00020 
00021 DigitalOut MotorR_EN(P0_21);     //Die Leitung führt zum Pin PO_21 am Prozessor
00022 DigitalOut MotorR_FORWARD(P1_3); //Die Leitung führt zum Pin P1_3 am Prozessor
00023 DigitalOut MotorR_REVERSE(P1_4);
00024 
00025 // *************  Hauptprogramm ************
00026 int main() {                 // Start Hauptprogramm
00027     MotorR_EN=MotorL_EN=1;   // Beide Motoren ENABLE
00028     while(1) {               // Anfang der Schleife (ohne Abbruch)   
00029         MotorR_FORWARD = MotorL_FORWARD = 1;  // Beide Motoren vorwärts EIN
00030         wait (1.0);          // warte 1 Sekunde  
00031         MotorR_FORWARD = MotorL_FORWARD = 0;  // Motoren AUS  
00032         wait (1.0);          // warte 1 Sekunde 
00033     }                        // Springe zum Anfang der Schleife 
00034 }                            // Ende des Hauptprogrammes
00035 
00036 // **************     ENDE     *************