Ultraschall Test Geschwindigkeitsregelung

Fork of BertlLib by michael hollegha

Files at this revision

API Documentation at this revision

Comitter:
TFuchsbichler
Date:
Mon Apr 25 06:55:29 2016 +0000
Parent:
6:78243412d2b3
Commit message:
Ultraschallsensor Test

Changed in this revision

Bertl14.cpp Show annotated file Show diff for this revision Revisions of this file
Bertl14.h Show annotated file Show diff for this revision Revisions of this file
BertlObjects.h Show annotated file Show diff for this revision Revisions of this file
diff -r 78243412d2b3 -r 01d2bc098b6d Bertl14.cpp
--- a/Bertl14.cpp	Thu Mar 05 17:39:16 2015 +0000
+++ b/Bertl14.cpp	Mon Apr 25 06:55:29 2016 +0000
@@ -2,41 +2,6 @@
 #include "mbed.h"
 #include "Bertl14.h"
 
-Motor::Motor(PinName pwm, PinName fwd, PinName rev) :
-_pwm(pwm), _fwd(fwd), _rev(rev) 
-{
-	_pwm.period(0.001); _pwm=0;
-	_fwd=0; _rev=0;
-}
-
-void Motor::SetPow(float aPow)
-{
-	if( aPow>=0.0 ) {
-		_fwd=1; _rev=0;
-		_pwm = aPow;
-	}
-	else {
-		_fwd=0; _rev=1;
-		_pwm = -aPow;
-	}
-}
-
-BertlDrive::BertlDrive(PinName pwm, PinName fwd, PinName rev, PinName encoder) :
-Motor(pwm,fwd,rev) , _enc(encoder)
-{
-	encCnt = 0;
-}
-
-void BertlDrive::Init()
-{
-	_enc.rise(this, &BertlDrive::EncoderISR);
-	_enc.fall(this, &BertlDrive::EncoderISR);
-}
-
-void BertlDrive::EncoderISR()
-{
-	encCnt++;
-}
 
 
 PortEx::PortEx() : 
diff -r 78243412d2b3 -r 01d2bc098b6d Bertl14.h
--- a/Bertl14.h	Thu Mar 05 17:39:16 2015 +0000
+++ b/Bertl14.h	Mon Apr 25 06:55:29 2016 +0000
@@ -2,27 +2,6 @@
 #ifndef Bertl14_h
 #define Bertl14_h
 
-class Motor {
-	public:
-		Motor(PinName pwm, PinName fwd, PinName rev);
-		void SetPow(float aPow);
-	protected:
-    PwmOut _pwm;
-    DigitalOut _fwd;
-    DigitalOut _rev;
-};
-
-class BertlDrive : public Motor {
-	public:
-		int16_t encCnt;
-	public:
-		BertlDrive(PinName pwm, PinName fwd, PinName rev, PinName encoder);
-		void Init();
-	private:
-		void EncoderISR();
-		InterruptIn _enc;
-};
-
 
 const int BTN_FLL = 0x80;
 const int BTN_FL  = 0x04;
diff -r 78243412d2b3 -r 01d2bc098b6d BertlObjects.h
--- a/BertlObjects.h	Thu Mar 05 17:39:16 2015 +0000
+++ b/BertlObjects.h	Mon Apr 25 06:55:29 2016 +0000
@@ -4,8 +4,6 @@
 BusOut leds(LED1,LED2,LED3,LED4);
 // DigitalOut ledBlue(P1_28); // 3 blaue LEDs
 
-BertlDrive mL(p34, P1_1, P1_0, P1_12); 
-BertlDrive mR(p36, P1_3, P1_4, P1_13);  // changed
 
 PortEx pex;
 UsDistSens us(p21,p22);
@@ -13,7 +11,6 @@
 void InitBertl()
 {
 	leds=0;
-  mL.Init(); mR.Init(); pex.Init();
 	pex.useISR=0;
 }