Skip to content

Commit

Permalink
add type hints - fixes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
rhooper committed Oct 31, 2021
1 parent e49e4be commit 6d39865
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion adafruit_waveform/sine.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Waveform.git"


def sine_wave(sample_frequency, pitch):
def sine_wave(sample_frequency: float, pitch: float):
"""Generate a single sine wav cycle at the given sampling frequency and pitch."""
length = int(sample_frequency / pitch)
b = array.array("H", [0] * length)
Expand Down
2 changes: 1 addition & 1 deletion adafruit_waveform/square.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Waveform.git"


def square_wave(sample_length=2):
def square_wave(sample_length: int = 2):
"""Generate a single square wave of sample_length size"""
square = array.array("H", [0] * sample_length)
for i in range(sample_length // 2):
Expand Down

0 comments on commit 6d39865

Please sign in to comment.