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 PES by
Revision 3:24e098715b78, committed 2017-04-04
- Comitter:
- itslinear
- Date:
- Tue Apr 04 13:27:59 2017 +0000
- Parent:
- 2:953263712480
- Child:
- 4:fdcf3b5009c6
- Commit message:
- hoi
Changed in this revision
--- a/Roboter.cpp Tue Apr 04 13:22:24 2017 +0000
+++ b/Roboter.cpp Tue Apr 04 13:27:59 2017 +0000
@@ -54,17 +54,23 @@
*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 (){
-
-
-
-
-}
+void Roboter::pickup ()
+{
+
+}
+
+void Roboter::turn() //im Kreis drehen
+{
+ *pwmL = 0.55f;
+ *pwmR = 0.45f;
+
+}
+
--- a/Roboter.h Tue Apr 04 13:22:24 2017 +0000
+++ b/Roboter.h Tue Apr 04 13:27:59 2017 +0000
@@ -14,16 +14,18 @@
void bandeAusweichen();
float readSensor1();
- void pickup();
+ void pickup();
+ void turn();
+
private:
IRSensor sensors[6];
-
+
PwmOut* pwmL;
PwmOut* pwmR;
-
-
+
+
--- a/main.cpp Tue Apr 04 13:22:24 2017 +0000
+++ b/main.cpp Tue Apr 04 13:27:59 2017 +0000
@@ -11,15 +11,14 @@
DigitalOut bit2(PC_3);
IRSensor sensors[6];
-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);
+PwmOut pwmL( PA_8 );
+PwmOut pwmR( PA_9 );
//indicator leds arround robot
DigitalOut leds[] = { PC_8, PC_6, PB_12, PA_7, PC_0, PC_9 };
@@ -33,9 +32,20 @@
while(1) {
- roboter1.bandeAusweichen();
- // roboter.readSensor1();
-
+ roboter1.kamera(); //Kameraauswertung
+
+ roboter1.getBlock
+
+ while(camY>20) { //ausweichen aktive solange Y-Wert von Kamera grösser als 20
+ roboter1.bandeAusweichen();
+ }
+
+ while(cam==0) { //im Kreis drehen bis Kamera einen Klotz sieht
+ if(
+ roboter1.turn();
+ }
+
+
wait(0.1f);
}
