KnightHolden
Published © GPL3+

Lab 1

It turns sound on and off with a switch. The tone is changed with a potentiometer.

BeginnerShowcase (no instructions)1 hour5
Lab 1

Things used in this project

Hardware components

Circuit Playground Express
Adafruit Circuit Playground Express
×1

Software apps and online services

MakeCode
Microsoft MakeCode

Story

Read more

Schematics

screenshot

It is a screenshot of the code.

Code

circuitplayground-Lab1.uf2

Makefile
It starts by setting the pull pin as A2 and puts it as up. It then sets the volume of the sound it will make to 128. It then checks if the digital A2 pin is not true. If it is not true then it reads the input for analog pin A1 from the potentiometer to set a value. It then sets the tone it plays using the value and plays it at 1/8 beat. If the switch is flipped then the sound is turned off.
No preview (download only).

Credits

KnightHolden
3 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.