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.
Dependencies: mbed
Fork of _B14_Lektion03c by
Diff: main.cpp
- Revision:
- 1:0ea49e814f60
- Parent:
- 0:0b7c22955b8c
- Child:
- 2:6a552b98b4cb
--- a/main.cpp Thu Nov 13 18:19:47 2014 +0000
+++ b/main.cpp Sun Jan 25 17:27:45 2015 +0000
@@ -1,34 +1,36 @@
/***********************************
-name: BERTL_2014_TEST
+name: BERTL_2014_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 an auf den Moter sieht, ist da + Zeichen
- immer LINKS OBEN zu sehen !
+ 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 MotorL_EN(p34);
+DigitalOut MotorL_EN(P1_15);
DigitalOut MotorL_FORWARD(P1_1);
DigitalOut MotorL_REVERSE(P1_0);
-DigitalOut MotorR_EN(p36);
-DigitalOut MotorR_FORWARD(P1_3);
+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
- MotorR_EN=MotorL_EN=1; // Beide Motoren ENABLE
+ 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); // warte 1 Sekunde
+ wait (1.0); // warte 1 Sekunde
MotorR_FORWARD = MotorL_FORWARD = 0; // Motoren AUS
- wait (1); // warte 1 Sekunde
+ wait (1.0); // warte 1 Sekunde
} // Springe zum Anfang der Schleife
-}
+} // Ende des Hauptprogrammes
// ************** ENDE *************
