CIS441 Proj MS 2b

Dependencies:   TextLCD MQTT

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AccCar.h Source File

AccCar.h

00001 #ifndef _ACC_CAR_H_
00002 #define _ACC_CAR_H_
00003 
00004 #include "mbed.h"
00005 #include "Road.h"
00006 #include "Communication.h"
00007 
00008 class Road;
00009 
00010 class AccCar{
00011 public:
00012     int id;
00013     int position;
00014     int speed;
00015     int flag;
00016     
00017     AccCar(int id, Road* road, int flag);
00018     void set_forward_car(AccCar* car);
00019     void set_target_speed(int speed);
00020     void update();
00021     void reset();
00022     
00023 protected:
00024     int target_speed;
00025     int cycle;
00026     bool waited;
00027     AccCar* forward_car;
00028     
00029     Road* road;
00030     Thread* thread; 
00031 };
00032 #endif