Dependencies:   Farbsensor IRSensorLib PID_Control Servo mbed PixyLib

Committer:
ZHAW_Prometheus
Date:
Wed May 10 08:59:22 2017 +0000
Revision:
0:422088ad7fc5
Child:
3:017c85c4b14b
Prom_Roebi_0.1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ZHAW_Prometheus 0:422088ad7fc5 1 #ifndef FAHREN_H
ZHAW_Prometheus 0:422088ad7fc5 2 #define FAHREN_H
ZHAW_Prometheus 0:422088ad7fc5 3
ZHAW_Prometheus 0:422088ad7fc5 4 #include <mbed.h>
ZHAW_Prometheus 0:422088ad7fc5 5 #include <cstdlib>
ZHAW_Prometheus 0:422088ad7fc5 6 #include "IRSensor.h"
ZHAW_Prometheus 0:422088ad7fc5 7
ZHAW_Prometheus 0:422088ad7fc5 8 class Fahren
ZHAW_Prometheus 0:422088ad7fc5 9 {
ZHAW_Prometheus 0:422088ad7fc5 10 public:
ZHAW_Prometheus 0:422088ad7fc5 11
ZHAW_Prometheus 0:422088ad7fc5 12 //Konstruktoren und Destruktoren
ZHAW_Prometheus 0:422088ad7fc5 13 Fahren(DigitalOut* enable, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2, AnalogIn* distance, DigitalOut* enableMotorDriver, PwmOut* pwmLeft, PwmOut* pwmRight);
ZHAW_Prometheus 0:422088ad7fc5 14 Fahren();
ZHAW_Prometheus 0:422088ad7fc5 15 virtual ~Fahren();
ZHAW_Prometheus 0:422088ad7fc5 16
ZHAW_Prometheus 0:422088ad7fc5 17 //Public Methoden
ZHAW_Prometheus 0:422088ad7fc5 18 void init(DigitalOut* enable, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2, AnalogIn* distance, DigitalOut* enableMotorDriver, PwmOut* pwmLeft, PwmOut* pwmRight);
ZHAW_Prometheus 0:422088ad7fc5 19 void setSerialOutput(Serial *pc);
ZHAW_Prometheus 0:422088ad7fc5 20 int getState();
ZHAW_Prometheus 0:422088ad7fc5 21 void fahrInit();
ZHAW_Prometheus 0:422088ad7fc5 22 void fahrRutine();
ZHAW_Prometheus 0:422088ad7fc5 23
ZHAW_Prometheus 0:422088ad7fc5 24 private:
ZHAW_Prometheus 0:422088ad7fc5 25 //Private Methoden
ZHAW_Prometheus 0:422088ad7fc5 26
ZHAW_Prometheus 0:422088ad7fc5 27
ZHAW_Prometheus 0:422088ad7fc5 28 //Private Eigenschaften
ZHAW_Prometheus 0:422088ad7fc5 29 IRSensor sensors[6];
ZHAW_Prometheus 0:422088ad7fc5 30 DigitalOut* enable;
ZHAW_Prometheus 0:422088ad7fc5 31 DigitalOut* bit0;
ZHAW_Prometheus 0:422088ad7fc5 32 DigitalOut* bit1;
ZHAW_Prometheus 0:422088ad7fc5 33 DigitalOut* bit2;
ZHAW_Prometheus 0:422088ad7fc5 34 AnalogIn* distance;
ZHAW_Prometheus 0:422088ad7fc5 35 DigitalOut* enableMotorDriver;
ZHAW_Prometheus 0:422088ad7fc5 36 PwmOut* pwmLeft;
ZHAW_Prometheus 0:422088ad7fc5 37 PwmOut* pwmRight;
ZHAW_Prometheus 0:422088ad7fc5 38
ZHAW_Prometheus 0:422088ad7fc5 39 int state;
ZHAW_Prometheus 0:422088ad7fc5 40 enum state {gerade=0,rechts,links,drehen,zurueck,zurueck_l,zurueck_r};
ZHAW_Prometheus 0:422088ad7fc5 41 Serial *pc;
ZHAW_Prometheus 0:422088ad7fc5 42 //Konstante
ZHAW_Prometheus 0:422088ad7fc5 43 static const double wenden =0.26;
ZHAW_Prometheus 0:422088ad7fc5 44 static const double wand =0.07;
ZHAW_Prometheus 0:422088ad7fc5 45 };
ZHAW_Prometheus 0:422088ad7fc5 46
ZHAW_Prometheus 0:422088ad7fc5 47 #endif