Dependencies: Farbsensor IRSensorLib PID_Control Servo mbed PixyLib
Diff: main.cpp
- Revision:
- 7:5949f408b6da
- Parent:
- 3:017c85c4b14b
- Child:
- 8:077d0bb213a2
--- a/main.cpp Tue May 16 14:02:23 2017 +0000 +++ b/main.cpp Wed May 17 07:38:41 2017 +0000 @@ -2,10 +2,11 @@ #include "cstdlib" #include "IRSensor.h" #include "Servo.h" -#include "Pixy.h" +//#include "Pixy.h" #include "Farbauswertung.h" #include "Fahren.h" #include "liftAnsteuerung.h" +#include "CamAusw.h" /** *Aus- und Eingänge initialisieren @@ -34,13 +35,15 @@ Servo ServoFoerder(PC_7); //Lift Servo ServoLift(PA_6); +//Kamera //Serielle Ausgabe Serial pc(SERIAL_TX,SERIAL_RX); +Camauswertung cam(1); Farbauswertung farbauswertung(&SensorG, &SensorR, &ServoAusw); -Fahren fahren(&enable, &bit0, &bit1, &bit2, &distance, &enableMotorDriver, &pwmLeft, &pwmRight); -LiftAnsteuerung lift(30, 5, &ServoLift); +Fahren fahren(&enable, &bit0, &bit1, &bit2, &distance, &enableMotorDriver, &pwmLeft, &pwmRight, &cam); +LiftAnsteuerung lift(100, 10, &ServoLift); int main() { @@ -58,8 +61,11 @@ Ticker drive; drive.attach(&fahren, &Fahren::fahrRutine, 0.01); - // Ticker elevator; - // elevator.attach(&lift, &LiftAnsteuerung::steuerung, 0.5); + Ticker elevator; + elevator.attach(&lift, &LiftAnsteuerung::steuerung, 0.01); + + Ticker camausw; + camausw.attach(&cam, &Camauswertung::auswertung, 0.01); while (1) {