Makeblock-library-for-Arduino  V3.2.4
It's a library for arduino application developers
Public Member Functions | List of all members
MeLineFollower Class Reference

Driver for Me line follwer device. More...

#include <MeLineFollower.h>

Inheritance diagram for MeLineFollower:
MePort

Public Member Functions

 MeLineFollower (void)
 
 MeLineFollower (uint8_t port)
 
void setpin (uint8_t Sensor1, uint8_t Sensor2)
 
uint8_t readSensors (void)
 
bool readSensor1 (void)
 
bool readSensor2 (void)
 
- Public Member Functions inherited from MePort
 MePort (void)
 
 MePort (uint8_t port)
 
 MePort (uint8_t port, uint8_t slot)
 
uint8_t getPort (void)
 
uint8_t getSlot (void)
 
bool dRead1 (uint8_t mode=INPUT)
 
bool dRead2 (uint8_t mode=INPUT)
 
bool dpRead1 (void)
 
bool dpRead2 (void)
 
void dWrite1 (bool value)
 
void dWrite2 (bool value)
 
int16_t aRead1 (void)
 
int16_t aRead2 (void)
 
void aWrite1 (int16_t value)
 
void aWrite2 (int16_t value)
 
void reset (uint8_t port)
 
void reset (uint8_t port, uint8_t slot)
 
uint8_t pin1 (void)
 
uint8_t pin2 (void)
 
uint8_t pin (void)
 
uint8_t pin (uint8_t port, uint8_t slot)
 

Additional Inherited Members

- Protected Attributes inherited from MePort
uint8_t s1
 
uint8_t s2
 
uint8_t _port
 
uint8_t _slot
 

Detailed Description

Driver for Me line follwer device.

Class: MeLineFollower

Description
Declaration of Class MeLineFollower.
Copyright (C), 2012-2016, MakeBlock

Constructor & Destructor Documentation

MeLineFollower::MeLineFollower ( void  )

Alternate Constructor which can call your own function to map the line follwer device to arduino port, no pins are used or initialized here.

Parameters
[in]None
MeLineFollower::MeLineFollower ( uint8_t  port)

Alternate Constructor which can call your own function to map the line follwer device to arduino port

Parameters
[in]port- RJ25 port from PORT_1 to M2

Member Function Documentation

bool MeLineFollower::readSensor1 ( void  )
Function
readSensor1
Description
Get the sensors1(left sensors) state.
Output
None
Returns
0: sensor1 is inside of black line
1: sensor1 is outside of black line
Others
None
bool MeLineFollower::readSensor2 ( void  )
Function
readSensor2
Description
Get the sensors2(right sensors) state.
Output
None
Returns
0: sensor1 is inside of black line
1: sensor1 is outside of black line
Others
None
uint8_t MeLineFollower::readSensors ( void  )
Function
readSensors
Description
Get the sensors state.
Output
None
Returns
(0x00)-S1_IN_S2_IN: sensor1 and sensor2 are both inside of black line
(0x01)-S1_IN_S2_OUT: sensor1 is inside of black line and sensor2 is outside of black line
(0x02)-S1_OUT_S2_IN: sensor1 is outside of black line and sensor2 is inside of black line
(0x03)-S1_OUT_S2_OUT: sensor1 and sensor2 are both outside of black line
Others
None
void MeLineFollower::setpin ( uint8_t  Sensor1,
uint8_t  Sensor2 
)
Function
setpin
Description
Reset the line follwer device available PIN by its arduino port.
Parameters
[in]Sensor1- arduino port(should digital pin)
[in]Sensor2- arduino port(should digital pin)
Output
None
Returns
None
Others
None

The documentation for this class was generated from the following files: