MakeBlock Drive Updated
Updated library for MakeBlock Ranger
Loading...
Searching...
No Matches
MeLineFollower.h
Go to the documentation of this file.
1
42#ifndef MeLineFollower_H
43#define MeLineFollower_H
44
45#include <stdint.h>
46#include <stdbool.h>
47#include <Arduino.h>
48#include "MeConfig.h"
49
50#ifdef ME_PORT_DEFINED
51#include "MePort.h"
52#endif // ME_PORT_DEFINED
53
54#define S1_IN_S2_IN (0x00) // sensor1 and sensor2 are both inside of black line
55#define S1_IN_S2_OUT (0x01) // sensor1 is inside of black line and sensor2 is outside of black line
56#define S1_OUT_S2_IN (0x02) // sensor1 is outside of black line and sensor2 is inside of black line
57#define S1_OUT_S2_OUT (0x03) // sensor1 and sensor2 are both outside of black line
58
64#ifndef ME_PORT_DEFINED
66#else // !ME_PORT_DEFINED
67class MeLineFollower : public MePort
68#endif // ME_PORT_DEFINED
69{
70public:
71#ifdef ME_PORT_DEFINED
78 MeLineFollower(void);
79
85 MeLineFollower(uint8_t port);
86#else // ME_PORT_DEFINED
95 MeLineFollower(uint8_t Sensor1,uint8_t Sensor2);
96#endif // ME_PORT_DEFINED
113 void setpin(uint8_t Sensor1,uint8_t Sensor2);
114
130 uint8_t readSensors(void);
131
145 bool readSensor1(void);
146
160 bool readSensor2(void);
161private:
162 volatile uint8_t _Sensor1;
163 volatile uint8_t _Sensor2;
164};
165#endif
Configuration file of library.
Header for MePort.cpp module.
Driver for Me line follwer device.
Definition MeLineFollower.h:69
MeLineFollower(void)
Definition MeLineFollower.cpp:53
bool readSensor2(void)
Definition MeLineFollower.cpp:177
uint8_t readSensors(void)
Definition MeLineFollower.cpp:128
bool readSensor1(void)
Definition MeLineFollower.cpp:155
Port Mapping for RJ25.
Definition MePort.h:128