MakeBlock Drive Updated Updated library for MakeBlock Ranger

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

Driver for Me Buzzer module. More...

`#include <src/MeBuzzer.h>`

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

## Public Member Functions
| MeBuzzer ()
| MeBuzzer (uint8_t port)
| MeBuzzer (uint8_t port, uint8_t slot)
void | setpin (int pin)
void | tone (int pin, uint16_t frequency, uint32_t duration)
void | tone (uint16_t frequency, uint32_t duration=0)
void | noTone (int pin)
void | noTone ()
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 Buzzer module.

Class: MeBuzzer

Description
  Declaration of Class MeBuzzer.

Copyright (C), 2012-2016, MakeBlock

## Constructor & Destructor Documentation

## ◆ MeBuzzer() [1/3]

MeBuzzer::MeBuzzer | ( |  | ) |

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

Parameters

  [in] | None |

Alternate Constructor which can call your own function to map the Buzzer to arduino port, Buzzer pins are used and initialized here.

Parameters

  [in] | None |

## ◆ MeBuzzer() [2/3]

MeBuzzer::MeBuzzer | ( | uint8_t | port | ) |

Alternate Constructor which can call your own function to map the Buzzer to arduino port, If the hardware serial was selected, we will used the hardware serial.

Parameters

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

## ◆ MeBuzzer() [3/3]

MeBuzzer::MeBuzzer | ( | uint8_t | port,
|  | uint8_t | slot
| ) |  |

Alternate Constructor which can call your own function to map the Buzzer to arduino port, you can set any slot for the buzzer device.

Parameters

  [in] | port | - RJ25 port from PORT_1 to M2
  [in] | slot | - SLOT1 or SLOT2

## Member Function Documentation

## ◆ noTone() [1/2]

void MeBuzzer::noTone | ( |  | ) |

Function
  noTone

Description
  Do not playing the tones.

Parameters

  [in] | None |

Output
  None \Return None.

Others
  None

## ◆ noTone() [2/2]

void MeBuzzer::noTone | ( | int | pin | ) |

Function
  noTone

Description
  Do not playing the tones.

Parameters

  [in] | pin | - Which pin on board that buzzer is connecting to.

Output
  None \Return None.

Others
  None

## ◆ setpin()

void MeBuzzer::setpin | ( | int | pin | ) |

Function
  setpin

Description
  Reset the buzzer available pin by its arduino port.

Parameters

  [in] | pin | - arduino port for buzzer detect pin.

Output
  None

Return
  None

Others
  None

## ◆ tone() [1/2]

void MeBuzzer::tone | ( | int | pin,
|  | uint16_t | frequency,
|  | uint32_t | duration
| ) |  |

Function
  tone

Description
  Playing the tones.

Parameters

  [in] | pin | - Which pin on board that buzzer is connecting to.
  [in] | frequency | - The speed of buzzer's tone play.
  [in] | duration | - Time of a tone play.

Output
  None \Return None.

Others
  Frequency (in hertz) and duration (in milliseconds).

## ◆ tone() [2/2]

void MeBuzzer::tone | ( | uint16_t | frequency,
|  | uint32_t | duration = `0`
| ) |  |

Function
  tone

Description
  Playing the tones.

Parameters

  [in] | frequency | - The speed of buzzer's tone play.
  [in] | duration | - Time of a tone play.

Output
  None \Return None.

Others
  Frequency (in hertz) and duration (in milliseconds).

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

- src/MeBuzzer.h
- src/MeBuzzer.cpp