-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31a14fd
commit 8a9e6df
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env pybricks-micropython | ||
#brickrun -r -- pybricks-micropython | ||
from pybricks.hubs import EV3Brick | ||
from pybricks.tools import wait, StopWatch, DataLog | ||
from pybricks.parameters import Color, Port | ||
from pybricks.ev3devices import Motor | ||
from pybricks.iodevices import AnalogSensor, UARTDevice | ||
# Initialize the EV3 | ||
ev3 = EV3Brick() | ||
ev3.speaker.beep() | ||
import os | ||
|
||
def record(length): | ||
os.system("arecord -D plughw:3,0 -t wav --duration="+str(length)+" test.wav") | ||
|
||
def playback(): | ||
os.system("aplay -D plughw:3,0 test.wav") | ||
|
||
record(3) | ||
wait(2000) | ||
playback() |