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.
Fork of _B15_T4_Motor by
Revision 3:8dab5659d872, committed 2016-04-21
- Comitter:
- Enenkel
- Date:
- Thu Apr 21 12:16:20 2016 +0000
- Parent:
- 2:416e90645a22
- Commit message:
- BERTL 16 Motorspannung und 5V EIN
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Jun 19 06:52:24 2015 +0000 +++ b/main.cpp Thu Apr 21 12:16:20 2016 +0000 @@ -1,40 +1,22 @@ /*********************************** -name: BERTL_2015_MOTOR_TEST +name: BERTL_16 12V on 21.4.2016 author: Gottfried Enenkel HTL BULME email: ene@bulme.at description: - Der BERTL fährt 1 sec lang VORWÄRTS! - Danach steht er für 1 sec + Die 12 V und 5 V werden eingeschalten - Wenn der Motor richtig eingebaut ist, - steht über dem Linken Anschluß ein PLUS - Wenn sich der BERTL dreht, ist ein Motor verkehrt eingebaut. ***********************************/ #include "mbed.h" // ************ DEKLARATIONEN ************** -DigitalOut Von (P1_2); // Motor Spannung ab BERTL15 nötig ! -DigitalOut MotorL_EN(P1_15); // Enable -DigitalOut MotorL_FORWARD(P1_1); // Forwerts -DigitalOut MotorL_REVERSE(P1_0); // Rückwerts +DigitalOut Von (P2_13); // Motor Spannung ab BERTL15 nötig ! -DigitalOut MotorR_EN(P0_21); //Die Leitung führt zum Pin PO_21 am Prozessor -DigitalOut MotorR_FORWARD(P1_3); //Die Leitung führt zum Pin P1_3 am Prozessor -DigitalOut MotorR_REVERSE(P1_4); // ************* Hauptprogramm ************ int main() { // Start Hauptprogramm Von=1; // Motor Spannung EIN - MotorR_EN=MotorL_EN=1; // Beide Motoren ENABLE - while(1) { // Anfang der Schleife (ohne Abbruch) - MotorR_FORWARD = 1; // RECHTER Motor vorwärts EIN - MotorL_FORWARD = 1; // LINKER Motoren vorwärts EIN - wait (1.0); // warte 1 Sekunde - MotorR_FORWARD = 0; // RECHTER Motor STOP - MotorL_FORWARD = 0; // LINKER Motoren STOP - wait (1.0); // warte 1 Sekunde - } // Springe zum Anfang der Schleife + } // Ende des Hauptprogrammes // ************** ENDE *************