Merge pull request #106 from waveform80/beep-beep

Fix #75
This commit is contained in:
Ben Nuttall
2015-11-15 11:50:19 +00:00
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 | | `on()` | Turn the buzzer on. | None |
| `off()` | Turn the buzzer off. | 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 | | `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`** | | `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 LED to be off 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`** | | | | `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 #### Properties

View File

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