MakeBlock Drive Updated Updated library for MakeBlock Ranger

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

Class for numeric display module. More...

`#include <src/Me7SegmentDisplay.h>`

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

## Public Member Functions
| Me7SegmentDisplay (void)
| Me7SegmentDisplay (uint8_t port)
void | reset (uint8_t port)
void | init (void)
void | set (uint8_t=BRIGHTNESS_2, uint8_t=ADDR_AUTO, uint8_t=STARTADDR)
void | setpin (uint8_t dataPin, uint8_t clkPin)
void | write (uint8_t SegData[])
void | write (uint8_t BitAddr, uint8_t SegData)
void | display (uint16_t value)
void | display (int16_t value)
void | display (float value)
void | display (long value)
int16_t | checkNum (float v, int16_t b)
void | display (double value, uint8_t=1)
void | display (uint8_t DispData[])
void | display (uint8_t BitAddr, uint8_t DispData)
void | display (uint8_t BitAddr, uint8_t DispData, uint8_t point_on)
void | clearDisplay (void)
void | setBrightness (uint8_t brightness)
void | coding (uint8_t DispData[])
uint8_t | coding (uint8_t DispData)
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

Class for numeric display module.

Driver for Me 7-Segment Serial Display module.

Class: Me7SegmentDisplay

Description
  Declaration of Class Me7SegmentDisplay.

Copyright (C), 2012-2016, MakeBlock

## Constructor & Destructor Documentation

## ◆ Me7SegmentDisplay() [1/2]

Me7SegmentDisplay::Me7SegmentDisplay | ( | void |  | ) |

Alternate Constructor which can call your own function to map the 7-Segment display to arduino port, no pins are used or initialized here.

Parameters

  [in] | None |

## ◆ Me7SegmentDisplay() [2/2]

Me7SegmentDisplay::Me7SegmentDisplay | ( | uint8_t | port | ) |

Alternate Constructor which can call your own function to map the 7-Segment display to arduino port, the slot1 will be used for data pin and slot2 will used for clk pin.

Parameters

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

## Member Function Documentation

## ◆ checkNum()

int16_t Me7SegmentDisplay::checkNum | ( | float | v,
|  | int16_t | b
| ) |  |

Function
  checkNum

Description
  Extraction values to be displayed of float data

Parameters

  [in] | v | - Value to display.
  [in] | b | - Value to display.

Output
  None

Returns
  The data removal of the decimal point

Others
  None

## ◆ clearDisplay()

void Me7SegmentDisplay::clearDisplay | ( | void |  | ) |

\Function clearDisplay \Description Clear display.

Output
  None

Return
  None

Others
  None

\Function clearDisplay \Description Clear display.

Output
  None

Return
  None

Others

## ◆ coding() [1/2]

uint8_t Me7SegmentDisplay::coding | ( | uint8_t | DispData | ) |

Function
  coding

Description
  Return display data from look up table.

Parameters

  [in] | DispData | - Data need be transcoded.

Output
  None

Returns
  Return the value of transcoding

Others
  None

## ◆ coding() [2/2]

void Me7SegmentDisplay::coding | ( | uint8_t | DispData[] | ) |

Function
  coding

Description
  Set display data using look up table.

Parameters

  [in] | DispData[] | - DataArray to display.

Output
  DispData[] - DataArray be transcoded.

Returns
  None

Others
  None

## ◆ display() [1/8]

void Me7SegmentDisplay::display | ( | double | value,
|  | uint8_t | digits = `1`
| ) |  |

Function
  display

Description
  Display double number.

Parameters

  [in] | value | - Value to display.
  [in] | digits | - Number of digits to display.

Output
  None

Returns
  None

Others
  None

## ◆ display() [2/8]

void Me7SegmentDisplay::display | ( | float | value | ) |

Function
  display

Description
  Display certain value, and this value type is float

Parameters

  [in] | value | - Value to display.

Output
  None

Returns
  None

Others
  None

## ◆ display() [3/8]

void Me7SegmentDisplay::display | ( | int16_t | value | ) |

Function
  display

Description
  Display certain value, and this value type is int16_t

Parameters

  [in] | value | - Value to display.

Output
  None

Returns
  None

Others
  None

## ◆ display() [4/8]

void Me7SegmentDisplay::display | ( | long | value | ) |

Function
  display

Description
  Display certain value, and this value type is long

Parameters

  [in] | value | - Value to display.

Output
  None

Returns
  None

Others
  None

## ◆ display() [5/8]

void Me7SegmentDisplay::display | ( | uint16_t | value | ) |

Function
  display

Description
  Display certain value, and this value type is uint16_t

Parameters

  [in] | value | - Value to display.

Output
  None

Returns
  None

Others
  None

## ◆ display() [6/8]

void Me7SegmentDisplay::display | ( | uint8_t | BitAddr,
|  | uint8_t | DispData
| ) |  |

Function
  display

Description
  Display data to certain digit.

Parameters

  [in] | BitAddr | - Address to display.
  [in] | DispData | - Data to display.

Output
  None

Returns
  None

Others
  None

## ◆ display() [7/8]

void Me7SegmentDisplay::display | ( | uint8_t | BitAddr,
|  | uint8_t | DispData,
|  | uint8_t | point_on
| ) |  |

Function
  display

Description
  Display data to certain digit.

Parameters

  [in] | BitAddr | - Address to display.
  [in] | DispData | - Data to display.
  [in] | point_on | - Display the point or not.

Output
  None

Returns
  None

Others
  None

## ◆ display() [8/8]

void Me7SegmentDisplay::display | ( | uint8_t | DispData[] | ) |

Function
  display

Description
  Display 8 bit number array.

Parameters

  [in] | DispData[] | - The data that needs to be displayed store in this array.

Output
  None

Returns
  None

Others
  None

## ◆ init()

void Me7SegmentDisplay::init | ( | void |  | ) |

Function
  init

Description
  Initialization the display, here just call function clearDisplay.

Output
  None

Returns
  None \others None

## ◆ reset()

void Me7SegmentDisplay::reset | ( | uint8_t | port | ) |

Function
  reset

Description
  Reset the port for Seven-Segment LED module, the prot here is RJ25 port from PORT_1 to M2.

Parameters

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

Output
  None

Return
  None

Others
  Set global variable _dataPin and _clkPin

## ◆ set()

void Me7SegmentDisplay::set | ( | uint8_t | brightness = `BRIGHTNESS_2`,
|  | uint8_t | SetData = `ADDR_AUTO`,
|  | uint8_t | SetAddr = `STARTADDR`
| ) |  |

Function
  set

Description
  Set brightness, data and address.

Parameters

  [in] | brightness | - Brightness, defined in Me7SegmentDisplay.h from BRIGHTNESS_0 to BRIGHTNESS_7.
  [in] | SetData | - First address for display data
  [in] | SetAddr | - First address for display

Output
  Cmd_SetData - Private variable Cmd_SetData of class Me7SegmentDisplay. Cmd_SetAddr - Private variable Cmd_SetAddr of class Me7SegmentDisplay. Cmd_DispCtrl - Control command for Me 7 Segment Serial Display module.

Returns
  None

Others
  None

## ◆ setBrightness()

void Me7SegmentDisplay::setBrightness | ( | uint8_t | brightness | ) |

Function
  setBrightness

Description
  Set brightness.

Parameters

  [in] | brightness | - Brightness, defined in Me7SegmentDisplay.h from BRIGHTNESS_0 to BRIGHTNESS_7.

Output
  Cmd_DispCtrl - Control command for Me 7 Segment Serial Display module.

Returns
  None

Others
  None

## ◆ setpin()

void Me7SegmentDisplay::setpin | ( | uint8_t | dataPin,
|  | uint8_t | clkPin
| ) |  |

Function
  setpin

Description
  Reset Seven-Segment LED module's data pin and its clock pin then clear display.

Parameters

  [in] | dataPin | - The DATA pin for Seven-Segment LED module(arduino port).
  [in] | clkPin | - The CLK pin for Seven-Segment LED module(arduino port).

Output
  None

Return
  None

Others
  Set global variable _KeyPin and _clkPin

## ◆ write() [1/2]

void Me7SegmentDisplay::write | ( | uint8_t | BitAddr,
|  | uint8_t | SegData
| ) |  |

Function
  write

Description
  Write data to certain address.

Parameters

  [in] | BitAddr | - Bit address of data.
  [in] | SegData | - Data to display.

Output
  None

Returns
  None \others None

## ◆ write() [2/2]

void Me7SegmentDisplay::write | ( | uint8_t | SegData[] | ) |

Function
  write

Description
  White data array to certain address.

Parameters

  [in] | SegData[] | - Data array to write to module.

Output
  None

Returns
  None

Others
  None

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

- src/Me7SegmentDisplay.h
- src/Me7SegmentDisplay.cpp