Alias blink to beep for Buzzer
This commit is contained in:
Dave Jones
2015-11-15 11:44:29 +00:00
parent 9804fd3ba0
commit f69b6195ca
2 changed files with 5 additions and 3 deletions

View File

@@ -110,10 +110,10 @@ Buzzer(pin=None, active_high=True)
| `on()` | Turn the buzzer on. | None |
| `off()` | Turn the buzzer off. | None |
| `toggle()` | Toggle the buzzer. If it's on, turn it off; if it's off, turn it on. | None |
| `blink()` | Make the LED turn on and off repeatedly. | `on_time` - The amount of time (in seconds) for the LED to be on each iteration. **Default: `1`** |
| | | `off_time` - The amount of time (in seconds) for the LED to be off each iteration. **Default: `1`** |
| `beep()` | Make the buzzer turn on and off repeatedly. | `on_time` - The amount of time (in seconds) for the buzzer to be on each iteration. **Default: `1`** |
| | | `off_time` - The amount of time (in seconds) for the buzzer to be off each iteration. **Default: `1`** |
| | | `n` - The number of iterations. `None` means infinite. **Default: `None`** |
| | | `background` - If `True`, start a background thread to continue blinking and return immediately. If `False`, only return when the blink is finished (warning: the default value of n will result in this method never returning). **Default: `True`** |
| | | `background` - If `True`, start a background thread to continue beeping and return immediately. If `False`, only return when the blink is finished (warning: the default value of n will result in this method never returning). **Default: `True`** |
#### Properties

View File

@@ -205,6 +205,8 @@ class Buzzer(DigitalOutputDevice):
"""
pass
Buzzer.beep = Buzzer.blink
class PWMOutputDevice(DigitalOutputDevice):
"""