Gruppe 3 / Mbed 2 deprecated PES1

Dependencies:   Servo mbed pixy

Fork of PES by Gruppe 3

Files at this revision

API Documentation at this revision

Comitter:
schneju2
Date:
Tue Apr 04 13:22:24 2017 +0000
Parent:
1:4e84271a70c6
Child:
3:24e098715b78
Commit message:
mit servos

Changed in this revision

Roboter.cpp Show annotated file Show diff for this revision Revisions of this file
Roboter.h Show annotated file Show diff for this revision Revisions of this file
Servo.lib Show annotated file Show diff for this revision Revisions of this file
Servos.cpp Show annotated file Show diff for this revision Revisions of this file
Servos.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Roboter.cpp	Tue Apr 04 11:55:54 2017 +0000
+++ b/Roboter.cpp	Tue Apr 04 13:22:24 2017 +0000
@@ -1,7 +1,7 @@
 #include "Roboter.h"
 
 
-Roboter::Roboter(AnalogIn* distance, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2, PwmOut* pwmL, PwmOut* pwmR)
+Roboter::Roboter(AnalogIn* distance, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2, PwmOut* pwmL, PwmOut* pwmR, Servo* s1, Servo* s2)
 {
 
     sensors[0].init( distance, bit0, bit1, bit2, 0);
@@ -54,7 +54,17 @@
     *pwmL = 0.5f+offsetDir+offsetLin; // Setzt die Duty-Cycle auf 50%
     *pwmR = 0.5f+offsetDir-offsetLin;
 
-    wait(0.1);
+    wait(0.1); 
+    }
+
+
+
 
-}
+void Roboter::pickup (){
+    
+   
+    
+    
+}    
 
+
--- a/Roboter.h	Tue Apr 04 11:55:54 2017 +0000
+++ b/Roboter.h	Tue Apr 04 13:22:24 2017 +0000
@@ -3,23 +3,27 @@
 
 #include <mbed.h>
 #include "IRSensor.h"
+#include "Servo.h"
 
 class Roboter
 {
 
 public:
 
-    Roboter(AnalogIn* distance, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2,   PwmOut * pwmL, PwmOut* pwmR);
+    Roboter(AnalogIn* distance, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2,   PwmOut * pwmL, PwmOut* pwmR, Servo* s1, Servo* s2);
 
     void bandeAusweichen();
     float readSensor1();
+    void pickup(); 
 
 private:
     IRSensor sensors[6];
+   
 
     PwmOut* pwmL;
     PwmOut* pwmR;
-
+    
+    
 
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Tue Apr 04 13:22:24 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Servo/#36b69a7ced07
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servos.cpp	Tue Apr 04 13:22:24 2017 +0000
@@ -0,0 +1,5 @@
+#include "Servos.h" 
+#include "Servo.h" 
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servos.h	Tue Apr 04 13:22:24 2017 +0000
@@ -0,0 +1,18 @@
+#ifndef SERVOS_H_
+#define SERVOS_H_
+
+#include <mbed.h>
+
+
+class Servos{
+    
+    public: 
+    
+    
+
+    
+    
+    
+    } 
+    
+    #endif /* SERVOS_H_ */
\ No newline at end of file
--- a/main.cpp	Tue Apr 04 11:55:54 2017 +0000
+++ b/main.cpp	Tue Apr 04 13:22:24 2017 +0000
@@ -14,13 +14,17 @@
 PwmOut pwmL( PA_8 );
 PwmOut pwmR( PA_9 );
 
+// Periphery for servos
+Servos servos1(PB_7);
+Servos servos2(PA_6);
+
 //motor stuff
 DigitalOut enableMotorDriver(PB_2);
 
 //indicator leds arround robot
 DigitalOut leds[] = { PC_8, PC_6, PB_12, PA_7, PC_0, PC_9 };
 
-Roboter roboter1(&distance, &bit0, &bit1, &bit2, &pwmL, &pwmR);
+Roboter roboter1(&distance, &bit0, &bit1, &bit2, &pwmL, &pwmR, &servos1,&servos2);
 
 int main()
 {
@@ -36,3 +40,4 @@
 
     }
 }
+