MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
Public Member Functions | List of all members
MeLightSensor Class Reference

Driver for Me-Light Sensor module. More...

`#include <src/MeLightSensor.h>`

Inheritance diagram for MeLightSensor:
[legend]
Collaboration diagram for MeLightSensor:
[legend]

## Public Member Functions
| MeLightSensor (void)
| MeLightSensor (uint8_t port)
void | setpin (uint8_t ledPin, uint8_t sensorPin)
int16_t | read (void)
void | lightOn (void)
void | lightOff (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-Light Sensor module.

Class: MeLightSensor

Description
  Declaration of Class MeLightSensor.

Copyright (C), 2012-2016, MakeBlock

## Constructor & Destructor Documentation

## ◆ MeLightSensor() [1/2]

MeLightSensor::MeLightSensor | ( | void |  | ) |

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

Parameters

  [in] | None |

## ◆ MeLightSensor() [2/2]

MeLightSensor::MeLightSensor | ( | uint8_t | port | ) |

Alternate Constructor which can call your own function to map the light sensor to arduino port

Parameters

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

## Member Function Documentation

## ◆ lightOff()

void MeLightSensor::lightOff | ( | void |  | ) |

Function
  lightOff

Description
  Turn off the LED on the light sensor.

Parameters

  [in] | None |

Output
  None

Return
  None

Others

## ◆ lightOn()

void MeLightSensor::lightOn | ( | void |  | ) |

Function
  lightOn

Description
  Turn on the LED on the light sensor.

Parameters

  [in] | None |

Output
  None

Return
  None

Others

## ◆ read()

int16_t MeLightSensor::read | ( | void |  | ) |

Function
  read

Description
  Read analog value of light sensor.

Parameters

  [in] | None |

Output
  None

Return
  MePort::aRead2() - DAC value of current light sensor's output.

Others

## ◆ setpin()

void MeLightSensor::setpin | ( | uint8_t | ledPin,
|  | uint8_t | sensorPin
| ) |  |

Function
  setpin

Description
  Set I2C data pin, clock pin and clear display.
  dataPin - the DATA pin for Seven-Segment LED module.
  clkPin - the CLK pin for Seven-Segment LED module.

Parameters

  [in] | ledPin | - Which pin on board that LEDpin is connecting to.
  [in] | sensorPin | - Which pin on board that sensorPin is connecting to.

Output
  None

Return
  None

Others
  Set global variable _KeyPin and s2

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

- src/MeLightSensor.h
- src/MeLightSensor.cpp