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
main.cpp
- Committer:
- Enenkel
- Date:
- 2015-05-31
- Revision:
- 1:0f7c167a4f97
- Parent:
- 0:a8a0195ed7dc
- Child:
- 2:416e90645a22
File content as of revision 1:0f7c167a4f97:
/*********************************** name: BERTL_2015_MOTOR_TEST 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 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 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 = MotorL_FORWARD = 1; // Beide Motoren vorwärts EIN wait (1.0); // warte 1 Sekunde MotorR_FORWARD = MotorL_FORWARD = 0; // Motoren AUS wait (1.0); // warte 1 Sekunde } // Springe zum Anfang der Schleife } // Ende des Hauptprogrammes // ************** ENDE *************