1
- # SPDX-FileCopyrightText: Copyright (c) 2020 Kattni Rembor for Adafruit Industries
1
+ # SPDX-FileCopyrightText: 2020 Kattni Rembor for Adafruit Industries
2
2
#
3
3
# SPDX-License-Identifier: MIT
4
- # The MIT License (MIT)
5
- #
6
- # Copyright (c) 2020 Kattni Rembor for Adafruit Industries
7
- #
8
- # Permission is hereby granted, free of charge, to any person obtaining a copy
9
- # of this software and associated documentation files (the "Software"), to deal
10
- # in the Software without restriction, including without limitation the rights
11
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- # copies of the Software, and to permit persons to whom the Software is
13
- # furnished to do so, subject to the following conditions:
14
- #
15
- # The above copyright notice and this permission notice shall be included in
16
- # all copies or substantial portions of the Software.
17
- #
18
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- # THE SOFTWARE.
4
+
25
5
"""
26
6
`adafruit_clue`
27
7
================================================================================
@@ -409,7 +389,7 @@ def shake(self, shake_threshold=30, avg_count=10, total_delay=0.1):
409
389
410
390
:param total_delay: The total time in seconds it takes to obtain avg_count
411
391
readings from acceleration. (Default 0.1)
412
- """
392
+ """
413
393
shake_accel = (0 , 0 , 0 )
414
394
for _ in range (avg_count ):
415
395
# shake_accel creates a list of tuples from acceleration data.
@@ -742,7 +722,7 @@ def _generate_sample(self, length=100):
742
722
self ._sine_wave_sample = audiocore .RawSample (self ._sine_wave )
743
723
744
724
def play_tone (self , frequency , duration ):
745
- """ Produce a tone using the speaker. Try changing frequency to change
725
+ """Produce a tone using the speaker. Try changing frequency to change
746
726
the pitch of the tone.
747
727
748
728
:param int frequency: The frequency of the tone in Hz
@@ -767,7 +747,7 @@ def play_tone(self, frequency, duration):
767
747
self .stop_tone ()
768
748
769
749
def start_tone (self , frequency ):
770
- """ Produce a tone using the speaker. Try changing frequency to change
750
+ """Produce a tone using the speaker. Try changing frequency to change
771
751
the pitch of the tone.
772
752
773
753
:param int frequency: The frequency of the tone in Hz
@@ -802,7 +782,7 @@ def start_tone(self, frequency):
802
782
self ._sample .play (self ._sine_wave_sample , loop = True )
803
783
804
784
def stop_tone (self ):
805
- """ Use with start_tone to stop the tone produced.
785
+ """Use with start_tone to stop the tone produced.
806
786
807
787
.. image :: ../docs/_static/speaker.jpg
808
788
:alt: Speaker
0 commit comments