Skip to content

Edits for style and sense #2641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions documentation/asciidoc/accessories/iqaudio/getting_started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

=== Creating a toy chatter box

As an example of what Raspberry Pi Audio boards can do, let's walk through the creation of a toy chatter box. Its on-board microphone, programmable button, and speaker driver make the Codec Zero an ideal choice for this application.
As an example of what Raspberry Pi Audio Boards can do, let's walk through the creation of a toy chatter box. Its on-board microphone, programmable button and speaker driver make the Codec Zero an ideal choice for this application.

image::images/Chatter_Box.jpg[width="80%"]

A random pre-recorded 5 second audio clip will be played when the button is pressed. After holding for ten seconds, a notifying burp sound will be emitted, after which a new 5 second clip will be recorded. Lastly, holding for more than 20 seconds will play a second burp sound and then erase all previous recordings.
A random pre-recorded five-second audio clip will be played when the button is pressed. After holding for ten seconds, a notifying burp sound will be emitted, after which a new five-second clip will be recorded. Holding the button down for more than 20 seconds will play a second burp sound, and then erase all previous recordings.

=== Hardware and wiring

For this project, any small passive speaker should be sufficient, we're using one available https://shop.pimoroni.com/products/3-speaker-4-3w?variant=380549926[here], which is a 3" 4Ω - 5W Speaker. We have also used an illuminated momentary push button button and a laser cut box to house all the components, but both are entirely optional. This example will work just using the Codec Zero on-board button, which is pre-wired to GPIO 27. Alternatively, you may use any momentary push button, such as those available https://shop.pimoroni.com/products/mini-arcade-buttons?variant=40377171274[here].
For this project, any small passive speaker should be sufficient. We're using one available https://shop.pimoroni.com/products/3-speaker-4-3w?variant=380549926[here], which handles 5W of power at 4Ω. We have also used an illuminated momentary push button, and a laser-cut box to house all the components; but both are entirely optional. This example will work just using the Codec Zero's on-board button, which is pre-wired to GPIO 27. (Alternatively, you can use any momentary push button, such as those available https://shop.pimoroni.com/products/mini-arcade-buttons?variant=40377171274[here].)

image::images/wiring.jpg[width="80%"]
Note - BRIAN TO ADD LABELS TO THIS PHOTO - GPIO 27, +5V, and Ground x2.

Use a small flat head screwdriver to attach your speaker to the screw terminals. For the additional push button, solder the button wires directly to the Codec Zero pads as indicated on GPIO pin 27 and Ground for the switch, and +5V and Ground for the LED, if necessary.
Use a small flat-head screwdriver to attach your speaker to the screw terminals. For the additional push button, solder the button wires directly to the Codec Zero pads as indicated, using GPIO pin 27 and Ground for the switch, and +5V and Ground for the LED, if necessary.

=== Setting up your Raspberry Pi

In this example, we are using Raspberry Pi OS Lite. Our guides on https://www.raspberrypi.com/documentation/computers/getting-started.html#installing-the-operating-system[Getting Started] cover this topic in great detail. Make sure that you update your operating system before proceeding and follow the instructions provided for Codec Zero Configuration, including the commands to enable the on-board microphone and speaker output.
In this example, we are using Raspberry Pi OS Lite. Our guides on https://www.raspberrypi.com/documentation/computers/getting-started.html#installing-the-operating-system[Getting started] cover this topic in great detail. Make sure that you update your operating system before proceeding and follow the instructions provided for Codec Zero configuration, including the commands to enable the on-board microphone and speaker output.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should be a relative URL rather than an absolute URL.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. We should use an xref: here not an absolute link.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're going to lower case the "s" you need to also lower case the "g"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because it's title case. (I do love arguing about capitalisation with you though, because I usually win, so keep it up.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly think it should be re-worded to,

In this example, we are using Raspberry Pi OS Lite. Our https://www.raspberrypi.com/documentation/computers/getting-started.html#installing-the-operating-system[getting started] guides cover this topic in great detail.

There's no real reason to Yoda it in the way it's written right now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text should be readable and make sense grammatically if the link is taken away. Right now that it's the case. The title case thing relies on the fact that this is a link to make it make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we leave this until we're in the same room on Wednesday so this takes two minutes rather than a distributed hour of typing?


=== Programming your Raspberry Pi

Expand Down Expand Up @@ -101,7 +101,7 @@ pause()

----

Ctrl X, Y and Enter to save and to make the script executable type the following:
Ctrl X, Y and Enter to save. To make the script executable, type the following:

----
$ sudo chmod +x chatter_box.py
Expand All @@ -113,7 +113,7 @@ Enter the following to create a crontab daemon that will automatically start the
$ crontab -e
----

You will be asked to select an editor, we recommend you use "nano". Select it by entering the corresponding number, and press Enter to continue. The following line should be added to the bottom of the file:
You will be asked to select an editor; we recommend you use `nano`. Select it by entering the corresponding number, and press Enter to continue. The following line should be added to the bottom of the file:

----
@reboot python /home/pi/chatter_box.py
Expand All @@ -123,12 +123,12 @@ Ctrl X, Y and Enter to save, then reboot your device.

=== Operating your device

The final step is to ensure that everything is operating as expected. Press the button and release it when you hear the burp. The recording will now begin for a period of five seconds. Once you have released the button, press it briefly again to hear the recording. Repeat this process as many times as you wish, and your sounds will be played at random. You can delete all recordings by pressing and holding the button, keeping the button pressed during the first burp and recoding process, and releasing it after at least 20 seconds, at which point you will hear another burp sound confirming that the recordings have been deleted.
The final step is to ensure that everything is operating as expected. Press the button and release it when you hear the burp. The recording will now begin for a period of five seconds. Once you have released the button, press it briefly again to hear the recording. Repeat this process as many times as you wish, and your sounds will be played at random. You can delete all recordings by pressing and holding the button, keeping the button pressed during the first burp and recording process, and releasing it after at least 20 seconds, at which point you will hear another burp sound confirming that the recordings have been deleted.

video::aUD_rcpc08I[youtube]

=== Moving forward
=== Next steps

Upgrades! It is always fun to upgrade a project, so why not add some additional features, such as an LED that will illuminate when recording? This project has all the parts required to make your own version of a https://aiyprojects.withgoogle.com/[Google intelligent speaker system], or you may want to consider building a second device that can be used to create a pair of walkie-talkies that are capable of transferring audio files over a network via SSH?
Upgrades! It is always fun to upgrade a project, so why not add some additional features, such as an LED that will illuminate when recording? This project has all the parts required to make your own version of a https://aiyprojects.withgoogle.com/[Google intelligent speaker system], or you may want to consider building a second device that can be used to create a pair of walkie-talkies that are capable of transferring audio files over a network via SSH.