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
main.cpp
- Committer:
- Enenkel
- Date:
- 2015-01-25
- Revision:
- 1:0ea49e814f60
- Parent:
- 0:0b7c22955b8c
- Child:
- 2:6a552b98b4cb
File content as of revision 1:0ea49e814f60:
/***********************************
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 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(P1_15);
DigitalOut MotorL_FORWARD(P1_1);
DigitalOut MotorL_REVERSE(P1_0);
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
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 *************
