Skip to content

Instantly share code, notes, and snippets.

@danasf
Last active June 11, 2023 16:54
Show Gist options
  • Save danasf/2769abb85e49e248989665e47e45f236 to your computer and use it in GitHub Desktop.
Save danasf/2769abb85e49e248989665e47e45f236 to your computer and use it in GitHub Desktop.
Making Things From Scraps - Kids Control Panel

Read Me

A fun control panel built from scrap, e-waste, and excess parts. It's fairly straight-forward to adapt this project to what you have available.

KtwLA.jpg

BOM

  • 16mm panel mount push buttons
  • Vintage style toggle switch
  • Potentiometer
  • WS2811 addressable LED string
  • ESP32
  • 5mm plywood or acrylic

Software

  • Arduino IDE
  • FastLED library

Enclosure

If you want to customize the box use the Electronics Box template with Boxes.py to generate an enclosure for laser cutting. You can uncheck the outsidemounts option unless you plan to mount the device on something. https://www.festi.info/boxes.py/ElectronicsBox

Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="322.00mm"
height="317.80mm"
viewBox="0.0 0.0 322.00 317.80"
version="1.1"
id="svg725"
sodipodi:docname="ChildrensControlPanel.svg"
inkscape:version="1.2.1 (9c6d41e, 2022-07-14)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs729" />
<sodipodi:namedview
id="namedview727"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.48993504"
inkscape:cx="446.99803"
inkscape:cy="579.66868"
inkscape:window-width="1661"
inkscape:window-height="720"
inkscape:window-x="156"
inkscape:window-y="45"
inkscape:window-maximized="0"
inkscape:current-layer="svg725" />
<!--
ElectronicsBox - Closed box with screw on top and mounting holes
Created with Boxes.py (https://festi.info/boxes.py)
Creation date: 2023-04-20 16:04:30
Command line (remove spaces between dashes): boxes ElectronicsBox - -x=155 - -y=120 - -h=65 - -outsidemounts=0 - -thickness=5.8
Url: http://www.festi.info/boxes.py/ElectronicsBox?FingerJoint_angle=90.0&FingerJoint_style=rectangular&FingerJoint_surroundingspaces=2.0&FingerJoint_bottom_lip=0.0&FingerJoint_edge_width=1.0&FingerJoint_extra_length=0.0&FingerJoint_finger=2.0&FingerJoint_play=0.0&FingerJoint_space=2.0&FingerJoint_width=1.0&x=155&y=120&h=65&outside=0&outside=1&triangle=25.0&d1=2.0&d2=3.0&d3=3.0&outsidemounts=0&holedist=7.0&thickness=5.8&format=svg&tabs=0.0&qr_code=0&debug=0&labels=0&labels=1&reference=100&inner_corners=loop&burn=0.1&language=en&render=2
Url short: http://www.festi.info/boxes.py/ElectronicsBox?x=155&y=120&h=65&outsidemounts=0&thickness=5.8
SettingsUrl: http://www.festi.info/boxes.py/ElectronicsBox?FingerJoint_angle=90.0&FingerJoint_style=rectangular&FingerJoint_surroundingspaces=2.0&FingerJoint_bottom_lip=0.0&FingerJoint_edge_width=1.0&FingerJoint_extra_length=0.0&FingerJoint_finger=2.0&FingerJoint_play=0.0&FingerJoint_space=2.0&FingerJoint_width=1.0&x=155&y=120&h=65&outside=0&outside=1&triangle=25.0&d1=2.0&d2=3.0&d3=3.0&outsidemounts=0&holedist=7.0&thickness=5.8&format=svg&tabs=0.0&qr_code=0&debug=0&labels=0&labels=1&reference=100&inner_corners=loop&burn=0.1&language=en&render=2
SettingsUrl short: http://www.festi.info/boxes.py/ElectronicsBox?x=155&y=120&h=65&outsidemounts=0&thickness=5.8
-->
<title
id="title637">ElectronicsBox</title>
<metadata
id="metadata639">
<rdf:RDF>
<cc:Work>
<dc:title>Box - ElectronicsBox</dc:title>
<dc:date>2023-04-20 16:04:30</dc:date>
<dc:source>http://www.festi.info/boxes.py/ElectronicsBox?FingerJoint_angle=90.0&amp;FingerJoint_style=rectangular&amp;FingerJoint_surroundingspaces=2.0&amp;FingerJoint_bottom_lip=0.0&amp;FingerJoint_edge_width=1.0&amp;FingerJoint_extra_length=0.0&amp;FingerJoint_finger=2.0&amp;FingerJoint_play=0.0&amp;FingerJoint_space=2.0&amp;FingerJoint_width=1.0&amp;x=155&amp;y=120&amp;h=65&amp;outside=0&amp;outside=1&amp;triangle=25.0&amp;d1=2.0&amp;d2=3.0&amp;d3=3.0&amp;outsidemounts=0&amp;holedist=7.0&amp;thickness=5.8&amp;format=svg&amp;tabs=0.0&amp;qr_code=0&amp;debug=0&amp;labels=0&amp;labels=1&amp;reference=100&amp;inner_corners=loop&amp;burn=0.1&amp;language=en&amp;render=2</dc:source>
<dc:source>http://www.festi.info/boxes.py/ElectronicsBox?x=155&amp;y=120&amp;h=65&amp;outsidemounts=0&amp;thickness=5.8</dc:source>
<dc:description>Closed box with screw on top and mounting holes
Created with Boxes.py (https://festi.info/boxes.py)
Command line: boxes ElectronicsBox --FingerJoint_angle=90.0 --FingerJoint_style=rectangular --FingerJoint_surroundingspaces=2.0 --FingerJoint_bottom_lip=0.0 --FingerJoint_edge_width=1.0 --FingerJoint_extra_length=0.0 --FingerJoint_finger=2.0 --FingerJoint_play=0.0 --FingerJoint_space=2.0 --FingerJoint_width=1.0 --x=155 --y=120 --h=65 --outside=0 --outside=1 --triangle=25.0 --d1=2.0 --d2=3.0 --d3=3.0 --outsidemounts=0 --holedist=7.0 --thickness=5.8 --format=svg --tabs=0.0 --qr_code=0 --debug=0 --labels=0 --labels=1 --reference=100 --inner_corners=loop --burn=0.1
Command line short: boxes ElectronicsBox --x=155 --y=120 --h=65 --outsidemounts=0 --thickness=5.8
Url: http://www.festi.info/boxes.py/ElectronicsBox?FingerJoint_angle=90.0&amp;FingerJoint_style=rectangular&amp;FingerJoint_surroundingspaces=2.0&amp;FingerJoint_bottom_lip=0.0&amp;FingerJoint_edge_width=1.0&amp;FingerJoint_extra_length=0.0&amp;FingerJoint_finger=2.0&amp;FingerJoint_play=0.0&amp;FingerJoint_space=2.0&amp;FingerJoint_width=1.0&amp;x=155&amp;y=120&amp;h=65&amp;outside=0&amp;outside=1&amp;triangle=25.0&amp;d1=2.0&amp;d2=3.0&amp;d3=3.0&amp;outsidemounts=0&amp;holedist=7.0&amp;thickness=5.8&amp;format=svg&amp;tabs=0.0&amp;qr_code=0&amp;debug=0&amp;labels=0&amp;labels=1&amp;reference=100&amp;inner_corners=loop&amp;burn=0.1&amp;language=en&amp;render=2
Url short: http://www.festi.info/boxes.py/ElectronicsBox?x=155&amp;y=120&amp;h=65&amp;outsidemounts=0&amp;thickness=5.8
SettingsUrl: http://www.festi.info/boxes.py/ElectronicsBox?FingerJoint_angle=90.0&amp;FingerJoint_style=rectangular&amp;FingerJoint_surroundingspaces=2.0&amp;FingerJoint_bottom_lip=0.0&amp;FingerJoint_edge_width=1.0&amp;FingerJoint_extra_length=0.0&amp;FingerJoint_finger=2.0&amp;FingerJoint_play=0.0&amp;FingerJoint_space=2.0&amp;FingerJoint_width=1.0&amp;x=155&amp;y=120&amp;h=65&amp;outside=0&amp;outside=1&amp;triangle=25.0&amp;d1=2.0&amp;d2=3.0&amp;d3=3.0&amp;outsidemounts=0&amp;holedist=7.0&amp;thickness=5.8&amp;format=svg&amp;tabs=0.0&amp;qr_code=0&amp;debug=0&amp;labels=0&amp;labels=1&amp;reference=100&amp;inner_corners=loop&amp;burn=0.1&amp;language=en&amp;render=2
SettingsUrl short: http://www.festi.info/boxes.py/ElectronicsBox?x=155&amp;y=120&amp;h=65&amp;outsidemounts=0&amp;thickness=5.8
</dc:description>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="p-0"
style="fill:none;stroke-linecap:round;stroke-linejoin:round;">
<path
d="M 10.400 307.800 H 110.400 V 297.800 H 10.400 V 307.800 Z"
stroke="rgb(0,0,0)"
stroke-width="0.20"
id="path641" />
<text
transform="matrix( 1.000 0.000 0.000 1.000 60.400 298.800 )"
style="font-family: sans-serif ; font-weight: normal; font-style: normal; fill: rgb(255,0,0)"
font-size="8px"
text-anchor="middle"
dominant-baseline="hanging"
id="text643">100mm, burn:0.10mm</text>
</g>
<g
id="p-1"
style="fill:none;stroke-linecap:round;stroke-linejoin:round;">
<path
d="M 28.700 241.100 H 23.000 C 22.900 241.100 23.000 241.200 23.000 241.100 V 235.500 C 23.000 235.400 22.900 235.500 23.000 235.500 H 34.400 C 34.500 235.500 34.400 235.400 34.400 235.500 V 241.100 C 34.400 241.200 34.500 241.100 34.400 241.100 H 28.700 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path646" />
<path
d="M 147.100 235.500 H 152.800 C 152.900 235.500 152.800 235.400 152.800 235.500 V 241.100 C 152.800 241.200 152.900 241.100 152.800 241.100 H 141.400 C 141.300 241.100 141.400 241.200 141.400 241.100 V 235.500 C 141.400 235.400 141.300 235.500 141.400 235.500 H 147.100 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path648" />
<text
transform="matrix( 1.000 0.000 0.000 1.000 87.900 260.200 )"
style="font-family: sans-serif ; font-weight: normal; font-style: normal; fill: rgb(255,0,0)"
font-size="4px"
text-anchor="middle"
dominant-baseline="hanging"
id="text650">Wall 1</text>
<path
d="M 16.200 288.900 H 35.600 C 35.700 288.900 35.600 288.800 35.600 288.900 V 294.600 C 35.600 294.655 35.645 294.700 35.700 294.700 H 47.300 C 47.355 294.700 47.400 294.655 47.400 294.600 V 288.900 C 47.400 288.800 47.300 288.900 47.400 288.900 H 58.800 C 58.900 288.900 58.800 288.800 58.800 288.900 V 294.600 C 58.800 294.655 58.845 294.700 58.900 294.700 H 70.500 C 70.555 294.700 70.600 294.655 70.600 294.600 V 288.900 C 70.600 288.800 70.500 288.900 70.600 288.900 H 82.000 C 82.100 288.900 82.000 288.800 82.000 288.900 V 294.600 C 82.000 294.655 82.045 294.700 82.100 294.700 H 93.700 C 93.755 294.700 93.800 294.655 93.800 294.600 V 288.900 C 93.800 288.800 93.700 288.900 93.800 288.900 H 105.200 C 105.300 288.900 105.200 288.800 105.200 288.900 V 294.600 C 105.200 294.655 105.245 294.700 105.300 294.700 H 116.900 C 116.955 294.700 117.000 294.655 117.000 294.600 V 288.900 C 117.000 288.800 116.900 288.900 117.000 288.900 H 128.400 C 128.500 288.900 128.400 288.800 128.400 288.900 V 294.600 C 128.400 294.655 128.445 294.700 128.500 294.700 H 140.100 C 140.155 294.700 140.200 294.655 140.200 294.600 V 288.900 C 140.200 288.800 140.100 288.900 140.200 288.900 H 159.600 H 165.400 C 165.455 288.900 165.500 288.855 165.500 288.800 V 276.600 C 165.500 276.545 165.455 276.500 165.400 276.500 H 159.700 C 159.600 276.500 159.700 276.600 159.700 276.500 V 265.100 C 159.700 265.000 159.600 265.100 159.700 265.100 H 165.400 C 165.455 265.100 165.500 265.055 165.500 265.000 V 253.400 C 165.500 253.345 165.455 253.300 165.400 253.300 H 159.700 C 159.600 253.300 159.700 253.400 159.700 253.300 V 241.900 C 159.700 241.800 159.600 241.900 159.700 241.900 H 165.400 C 165.455 241.900 165.500 241.855 165.500 241.800 V 229.600 C 165.500 229.545 165.455 229.500 165.400 229.500 H 159.600 H 16.200 H 10.400 C 10.345 229.500 10.300 229.545 10.300 229.600 V 241.800 C 10.300 241.855 10.345 241.900 10.400 241.900 H 16.100 C 16.200 241.900 16.100 241.800 16.100 241.900 V 253.300 C 16.100 253.400 16.200 253.300 16.100 253.300 H 10.400 C 10.345 253.300 10.300 253.345 10.300 253.400 V 265.000 C 10.300 265.055 10.345 265.100 10.400 265.100 H 16.100 C 16.200 265.100 16.100 265.000 16.100 265.100 V 276.500 C 16.100 276.600 16.200 276.500 16.100 276.500 H 10.400 C 10.345 276.500 10.300 276.545 10.300 276.600 V 288.800 C 10.300 288.855 10.345 288.900 10.400 288.900 H 16.200"
stroke="rgb(0,0,0)"
stroke-width="0.20"
id="path652" />
</g>
<g
id="p-2"
style="fill:none;stroke-linecap:round;stroke-linejoin:round;">
<path
d="M 186.800 241.100 H 181.100 C 181.000 241.100 181.100 241.200 181.100 241.100 V 235.500 C 181.100 235.400 181.000 235.500 181.100 235.500 H 192.500 C 192.600 235.500 192.500 235.400 192.500 235.500 V 241.100 C 192.500 241.200 192.600 241.100 192.500 241.100 H 186.800 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path655" />
<path
d="M 270.200 235.500 H 275.900 C 276.000 235.500 275.900 235.400 275.900 235.500 V 241.100 C 275.900 241.200 276.000 241.100 275.900 241.100 H 264.500 C 264.400 241.100 264.500 241.200 264.500 241.100 V 235.500 C 264.500 235.400 264.400 235.500 264.500 235.500 H 270.200 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path657" />
<text
transform="matrix( 1.000 0.000 0.000 1.000 228.500 260.200 )"
style="font-family: sans-serif ; font-weight: normal; font-style: normal; fill: rgb(255,0,0)"
font-size="4px"
text-anchor="middle"
dominant-baseline="hanging"
id="text659">Wall 2</text>
<path
d="M 174.300 288.900 H 187.800 C 187.900 288.900 187.800 288.800 187.800 288.900 V 294.600 C 187.800 294.655 187.845 294.700 187.900 294.700 H 199.500 C 199.555 294.700 199.600 294.655 199.600 294.600 V 288.900 C 199.600 288.800 199.500 288.900 199.600 288.900 H 211.000 C 211.100 288.900 211.000 288.800 211.000 288.900 V 294.600 C 211.000 294.655 211.045 294.700 211.100 294.700 H 222.700 C 222.755 294.700 222.800 294.655 222.800 294.600 V 288.900 C 222.800 288.800 222.700 288.900 222.800 288.900 H 234.200 C 234.300 288.900 234.200 288.800 234.200 288.900 V 294.600 C 234.200 294.655 234.245 294.700 234.300 294.700 H 245.900 C 245.955 294.700 246.000 294.655 246.000 294.600 V 288.900 C 246.000 288.800 245.900 288.900 246.000 288.900 H 257.400 C 257.500 288.900 257.400 288.800 257.400 288.900 V 294.600 C 257.400 294.655 257.445 294.700 257.500 294.700 H 269.100 C 269.155 294.700 269.200 294.655 269.200 294.600 V 288.900 C 269.200 288.800 269.100 288.900 269.200 288.900 H 282.700 C 282.755 288.900 282.800 288.855 282.800 288.800 V 276.700 C 282.800 276.600 282.700 276.700 282.800 276.700 H 288.500 C 288.555 276.700 288.600 276.655 288.600 276.600 V 265.000 C 288.600 264.945 288.555 264.900 288.500 264.900 H 282.800 C 282.700 264.900 282.800 265.000 282.800 264.900 V 253.500 C 282.800 253.400 282.700 253.500 282.800 253.500 H 288.500 C 288.555 253.500 288.600 253.455 288.600 253.400 V 241.800 C 288.600 241.745 288.555 241.700 288.500 241.700 H 282.800 C 282.700 241.700 282.800 241.800 282.800 241.700 V 229.600 C 282.800 229.545 282.755 229.500 282.700 229.500 H 174.300 C 174.245 229.500 174.200 229.545 174.200 229.600 V 241.700 C 174.200 241.800 174.300 241.700 174.200 241.700 H 168.500 C 168.445 241.700 168.400 241.745 168.400 241.800 V 253.400 C 168.400 253.455 168.445 253.500 168.500 253.500 H 174.200 C 174.300 253.500 174.200 253.400 174.200 253.500 V 264.900 C 174.200 265.000 174.300 264.900 174.200 264.900 H 168.500 C 168.445 264.900 168.400 264.945 168.400 265.000 V 276.600 C 168.400 276.655 168.445 276.700 168.500 276.700 H 174.200 C 174.300 276.700 174.200 276.600 174.200 276.700 V 288.800 C 174.200 288.855 174.245 288.900 174.300 288.900"
stroke="rgb(0,0,0)"
stroke-width="0.20"
id="path661" />
</g>
<g
id="p-3"
style="fill:none;stroke-linecap:round;stroke-linejoin:round;">
<path
d="M 186.800 173.000 H 181.100 C 181.000 173.000 181.100 173.100 181.100 173.000 V 167.400 C 181.100 167.300 181.000 167.400 181.100 167.400 H 192.500 C 192.600 167.400 192.500 167.300 192.500 167.400 V 173.000 C 192.500 173.100 192.600 173.000 192.500 173.000 H 186.800 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path664" />
<path
d="M 270.200 167.400 H 275.900 C 276.000 167.400 275.900 167.300 275.900 167.400 V 173.000 C 275.900 173.100 276.000 173.000 275.900 173.000 H 264.500 C 264.400 173.000 264.500 173.100 264.500 173.000 V 167.400 C 264.500 167.300 264.400 167.400 264.500 167.400 H 270.200 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path666" />
<text
transform="matrix( 1.000 0.000 0.000 1.000 228.500 192.100 )"
style="font-family: sans-serif ; font-weight: normal; font-style: normal; fill: rgb(255,0,0)"
font-size="4px"
text-anchor="middle"
dominant-baseline="hanging"
id="text668">Wall 4</text>
<path
d="M 174.300 220.800 H 187.800 C 187.900 220.800 187.800 220.700 187.800 220.800 V 226.500 C 187.800 226.555 187.845 226.600 187.900 226.600 H 199.500 C 199.555 226.600 199.600 226.555 199.600 226.500 V 220.800 C 199.600 220.700 199.500 220.800 199.600 220.800 H 211.000 C 211.100 220.800 211.000 220.700 211.000 220.800 V 226.500 C 211.000 226.555 211.045 226.600 211.100 226.600 H 222.700 C 222.755 226.600 222.800 226.555 222.800 226.500 V 220.800 C 222.800 220.700 222.700 220.800 222.800 220.800 H 234.200 C 234.300 220.800 234.200 220.700 234.200 220.800 V 226.500 C 234.200 226.555 234.245 226.600 234.300 226.600 H 245.900 C 245.955 226.600 246.000 226.555 246.000 226.500 V 220.800 C 246.000 220.700 245.900 220.800 246.000 220.800 H 257.400 C 257.500 220.800 257.400 220.700 257.400 220.800 V 226.500 C 257.400 226.555 257.445 226.600 257.500 226.600 H 269.100 C 269.155 226.600 269.200 226.555 269.200 226.500 V 220.800 C 269.200 220.700 269.100 220.800 269.200 220.800 H 282.700 C 282.755 220.800 282.800 220.755 282.800 220.700 V 208.600 C 282.800 208.500 282.700 208.600 282.800 208.600 H 288.500 C 288.555 208.600 288.600 208.555 288.600 208.500 V 196.900 C 288.600 196.845 288.555 196.800 288.500 196.800 H 282.800 C 282.700 196.800 282.800 196.900 282.800 196.800 V 185.400 C 282.800 185.300 282.700 185.400 282.800 185.400 H 288.500 C 288.555 185.400 288.600 185.355 288.600 185.300 V 173.700 C 288.600 173.645 288.555 173.600 288.500 173.600 H 282.800 C 282.700 173.600 282.800 173.700 282.800 173.600 V 161.500 C 282.800 161.445 282.755 161.400 282.700 161.400 H 174.300 C 174.245 161.400 174.200 161.445 174.200 161.500 V 173.600 C 174.200 173.700 174.300 173.600 174.200 173.600 H 168.500 C 168.445 173.600 168.400 173.645 168.400 173.700 V 185.300 C 168.400 185.355 168.445 185.400 168.500 185.400 H 174.200 C 174.300 185.400 174.200 185.300 174.200 185.400 V 196.800 C 174.200 196.900 174.300 196.800 174.200 196.800 H 168.500 C 168.445 196.800 168.400 196.845 168.400 196.900 V 208.500 C 168.400 208.555 168.445 208.600 168.500 208.600 H 174.200 C 174.300 208.600 174.200 208.500 174.200 208.600 V 220.700 C 174.200 220.755 174.245 220.800 174.300 220.800"
stroke="rgb(0,0,0)"
stroke-width="0.20"
id="path670" />
</g>
<g
id="p-4"
style="fill:none;stroke-linecap:round;stroke-linejoin:round;">
<path
d="M 28.700 173.000 H 23.000 C 22.900 173.000 23.000 173.100 23.000 173.000 V 167.400 C 23.000 167.300 22.900 167.400 23.000 167.400 H 34.400 C 34.500 167.400 34.400 167.300 34.400 167.400 V 173.000 C 34.400 173.100 34.500 173.000 34.400 173.000 H 28.700 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path673" />
<path
d="M 147.100 167.400 H 152.800 C 152.900 167.400 152.800 167.300 152.800 167.400 V 173.000 C 152.800 173.100 152.900 173.000 152.800 173.000 H 141.400 C 141.300 173.000 141.400 173.100 141.400 173.000 V 167.400 C 141.400 167.300 141.300 167.400 141.400 167.400 H 147.100 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path675" />
<text
transform="matrix( 1.000 0.000 0.000 1.000 87.900 192.100 )"
style="font-family: sans-serif ; font-weight: normal; font-style: normal; fill: rgb(255,0,0)"
font-size="4px"
text-anchor="middle"
dominant-baseline="hanging"
id="text677">Wall 3</text>
<path
d="M 16.200 220.800 H 35.600 C 35.700 220.800 35.600 220.700 35.600 220.800 V 226.500 C 35.600 226.555 35.645 226.600 35.700 226.600 H 47.300 C 47.355 226.600 47.400 226.555 47.400 226.500 V 220.800 C 47.400 220.700 47.300 220.800 47.400 220.800 H 58.800 C 58.900 220.800 58.800 220.700 58.800 220.800 V 226.500 C 58.800 226.555 58.845 226.600 58.900 226.600 H 70.500 C 70.555 226.600 70.600 226.555 70.600 226.500 V 220.800 C 70.600 220.700 70.500 220.800 70.600 220.800 H 82.000 C 82.100 220.800 82.000 220.700 82.000 220.800 V 226.500 C 82.000 226.555 82.045 226.600 82.100 226.600 H 93.700 C 93.755 226.600 93.800 226.555 93.800 226.500 V 220.800 C 93.800 220.700 93.700 220.800 93.800 220.800 H 105.200 C 105.300 220.800 105.200 220.700 105.200 220.800 V 226.500 C 105.200 226.555 105.245 226.600 105.300 226.600 H 116.900 C 116.955 226.600 117.000 226.555 117.000 226.500 V 220.800 C 117.000 220.700 116.900 220.800 117.000 220.800 H 128.400 C 128.500 220.800 128.400 220.700 128.400 220.800 V 226.500 C 128.400 226.555 128.445 226.600 128.500 226.600 H 140.100 C 140.155 226.600 140.200 226.555 140.200 226.500 V 220.800 C 140.200 220.700 140.100 220.800 140.200 220.800 H 159.600 H 165.400 C 165.455 220.800 165.500 220.755 165.500 220.700 V 208.500 C 165.500 208.445 165.455 208.400 165.400 208.400 H 159.700 C 159.600 208.400 159.700 208.500 159.700 208.400 V 197.000 C 159.700 196.900 159.600 197.000 159.700 197.000 H 165.400 C 165.455 197.000 165.500 196.955 165.500 196.900 V 185.300 C 165.500 185.245 165.455 185.200 165.400 185.200 H 159.700 C 159.600 185.200 159.700 185.300 159.700 185.200 V 173.800 C 159.700 173.700 159.600 173.800 159.700 173.800 H 165.400 C 165.455 173.800 165.500 173.755 165.500 173.700 V 161.500 C 165.500 161.445 165.455 161.400 165.400 161.400 H 159.600 H 16.200 H 10.400 C 10.345 161.400 10.300 161.445 10.300 161.500 V 173.700 C 10.300 173.755 10.345 173.800 10.400 173.800 H 16.100 C 16.200 173.800 16.100 173.700 16.100 173.800 V 185.200 C 16.100 185.300 16.200 185.200 16.100 185.200 H 10.400 C 10.345 185.200 10.300 185.245 10.300 185.300 V 196.900 C 10.300 196.955 10.345 197.000 10.400 197.000 H 16.100 C 16.200 197.000 16.100 196.900 16.100 197.000 V 208.400 C 16.100 208.500 16.200 208.400 16.100 208.400 H 10.400 C 10.345 208.400 10.300 208.445 10.300 208.500 V 220.700 C 10.300 220.755 10.345 220.800 10.400 220.800 H 16.200"
stroke="rgb(0,0,0)"
stroke-width="0.20"
id="path679" />
</g>
<path
d="m 16.2,158.5 h 19.5 c 0.055,0 0.1,-0.045 0.1,-0.1 v -5.7 c 0,-0.1 -0.1,0 0,0 h 11.4 c 0.1,0 0,-0.1 0,0 v 5.7 c 0,0.055 0.045,0.1 0.1,0.1 h 11.6 c 0.055,0 0.1,-0.045 0.1,-0.1 v -5.7 c 0,-0.1 -0.1,0 0,0 h 11.4 c 0.1,0 0,-0.1 0,0 v 5.7 c 0,0.055 0.045,0.1 0.1,0.1 h 11.6 c 0.055,0 0.1,-0.045 0.1,-0.1 v -5.7 c 0,-0.1 -0.1,0 0,0 h 11.4 c 0.1,0 0,-0.1 0,0 v 5.7 c 0,0.055 0.045,0.1 0.1,0.1 h 11.6 c 0.055,0 0.1,-0.045 0.1,-0.1 v -5.7 c 0,-0.1 -0.1,0 0,0 h 11.4 c 0.1,0 0,-0.1 0,0 v 5.7 c 0,0.055 0.045,0.1 0.1,0.1 h 11.6 c 0.055,0 0.1,-0.045 0.1,-0.1 v -5.7 c 0,-0.1 -0.1,0 0,0 H 140 c 0.1,0 0,-0.1 0,0 v 5.7 c 0,0.055 0.045,0.1 0.1,0.1 h 19.5 5.8 c 0.055,0 0.1,-0.045 0.1,-0.1 V 152.6 139 c 0,-0.055 -0.045,-0.1 -0.1,-0.1 h -5.7 c -0.1,0 0,0.1 0,0 v -11.4 c 0,-0.1 -0.1,0 0,0 h 5.7 c 0.055,0 0.1,-0.045 0.1,-0.1 v -11.6 c 0,-0.055 -0.045,-0.1 -0.1,-0.1 h -5.7 c -0.1,0 0,0.1 0,0 v -11.4 c 0,-0.1 -0.1,0 0,0 h 5.7 c 0.055,0 0.1,-0.045 0.1,-0.1 V 92.6 c 0,-0.055 -0.045,-0.1 -0.1,-0.1 h -5.7 c -0.1,0 0,0.1 0,0 V 81.1 c 0,-0.1 -0.1,0 0,0 h 5.7 c 0.055,0 0.1,-0.045 0.1,-0.1 V 69.4 c 0,-0.055 -0.045,-0.1 -0.1,-0.1 h -5.7 c -0.1,0 0,0.1 0,0 V 57.9 c 0,-0.1 -0.1,0 0,0 h 5.7 c 0.055,0 0.1,-0.045 0.1,-0.1 V 44.2 38.4 c 0,-0.055 -0.045,-0.1 -0.1,-0.1 h -5.8 -19.5 c -0.055,0 -0.1,0.045 -0.1,0.1 v 5.7 c 0,0.1 0.1,0 0,0 h -11.4 c -0.1,0 0,0.1 0,0 v -5.7 c 0,-0.055 -0.045,-0.1 -0.1,-0.1 h -11.6 c -0.055,0 -0.1,0.045 -0.1,0.1 v 5.7 c 0,0.1 0.1,0 0,0 h -11.4 c -0.1,0 0,0.1 0,0 v -5.7 c 0,-0.055 -0.045,-0.1 -0.1,-0.1 H 93.7 c -0.055,0 -0.1,0.045 -0.1,0.1 v 5.7 c 0,0.1 0.1,0 0,0 H 82.2 c -0.1,0 0,0.1 0,0 v -5.7 c 0,-0.055 -0.045,-0.1 -0.1,-0.1 H 70.5 c -0.055,0 -0.1,0.045 -0.1,0.1 v 5.7 c 0,0.1 0.1,0 0,0 H 59 c -0.1,0 0,0.1 0,0 v -5.7 c 0,-0.055 -0.045,-0.1 -0.1,-0.1 H 47.3 c -0.055,0 -0.1,0.045 -0.1,0.1 v 5.7 c 0,0.1 0.1,0 0,0 H 35.8 c -0.1,0 0,0.1 0,0 v -5.7 c 0,-0.055 -0.045,-0.1 -0.1,-0.1 H 16.2 10.4 c -0.055,0 -0.1,0.045 -0.1,0.1 v 5.8 13.6 c 0,0.055 0.045,0.1 0.1,0.1 h 5.7 c 0.1,0 0,-0.1 0,0 v 11.4 c 0,0.1 0.1,0 0,0 h -5.7 c -0.055,0 -0.1,0.045 -0.1,0.1 V 81 c 0,0.055 0.045,0.1 0.1,0.1 h 5.7 c 0.1,0 0,-0.1 0,0 v 11.4 c 0,0.1 0.1,0 0,0 h -5.7 c -0.055,0 -0.1,0.045 -0.1,0.1 v 11.6 c 0,0.055 0.045,0.1 0.1,0.1 h 5.7 c 0.1,0 0,-0.1 0,0 v 11.4 c 0,0.1 0.1,0 0,0 h -5.7 c -0.055,0 -0.1,0.045 -0.1,0.1 v 11.6 c 0,0.055 0.045,0.1 0.1,0.1 h 5.7 c 0.1,0 0,-0.1 0,0 v 11.4 c 0,0.1 0.1,0 0,0 h -5.7 c -0.055,0 -0.1,0.045 -0.1,0.1 v 13.6 5.8 c 0,0.055 0.045,0.1 0.1,0.1 h 5.8"
stroke="#000000"
stroke-width="0.2"
id="path686"
style="fill:none;stroke-linecap:round;stroke-linejoin:round" />
<path
d="m 178.233,150.067 c 0,0.268 -0.077,0.531 -0.222,0.757 -0.145,0.225 -0.352,0.405 -0.596,0.516 -0.244,0.112 -0.515,0.151 -0.781,0.112 -0.266,-0.038 -0.515,-0.152 -0.717,-0.327 -0.203,-0.176 -0.351,-0.406 -0.427,-0.664 -0.076,-0.257 -0.076,-0.531 0,-0.789 0.076,-0.257 0.224,-0.488 0.427,-0.663 0.202,-0.176 0.451,-0.29 0.717,-0.328 0.266,-0.038 0.537,10e-4 0.781,0.112 0.244,0.112 0.451,0.291 0.596,0.517 0.145,0.226 0.222,0.488 0.222,0.757 z"
stroke="#0000ff"
stroke-width="0.2"
id="path695"
style="fill:none;stroke-linecap:round;stroke-linejoin:round" />
<path
d="m 168.5,158.5 h 143.4 c 0.055,0 0.1,-0.045 0.1,-0.1 V 50 c 0,-0.055 -0.045,-0.1 -0.1,-0.1 H 168.5 c -0.055,0 -0.1,0.045 -0.1,0.1 v 108.4 c 0,0.055 0.045,0.1 0.1,0.1"
stroke="#000000"
stroke-width="0.2"
id="path699"
style="fill:none;stroke-linecap:round;stroke-linejoin:round" />
<path
d="m 303.567,148.667 c 0.268,0 0.531,0.077 0.757,0.222 0.225,0.145 0.405,0.352 0.516,0.596 0.112,0.244 0.151,0.515 0.112,0.781 -0.038,0.266 -0.152,0.515 -0.327,0.717 -0.176,0.203 -0.406,0.351 -0.664,0.427 -0.257,0.076 -0.531,0.076 -0.789,0 -0.257,-0.076 -0.488,-0.224 -0.663,-0.427 -0.176,-0.202 -0.29,-0.451 -0.328,-0.717 -0.038,-0.266 0.001,-0.537 0.112,-0.781 0.112,-0.244 0.291,-0.451 0.517,-0.596 0.226,-0.145 0.488,-0.222 0.757,-0.222 z"
stroke="#0000ff"
stroke-width="0.2"
id="path701"
style="fill:none;stroke-linecap:round;stroke-linejoin:round" />
<path
d="m 302.167,58.333 c 0,-0.268 0.077,-0.531 0.222,-0.757 0.145,-0.225 0.352,-0.405 0.596,-0.516 0.244,-0.112 0.515,-0.151 0.781,-0.112 0.266,0.038 0.515,0.152 0.717,0.327 0.203,0.176 0.351,0.406 0.427,0.664 0.076,0.257 0.076,0.531 0,0.789 -0.076,0.257 -0.224,0.488 -0.427,0.663 -0.202,0.176 -0.451,0.29 -0.717,0.328 -0.266,0.038 -0.537,-10e-4 -0.781,-0.112 -0.244,-0.112 -0.451,-0.291 -0.596,-0.517 -0.145,-0.226 -0.222,-0.488 -0.222,-0.757 z"
stroke="#0000ff"
stroke-width="0.2"
id="path703"
style="fill:none;stroke-linecap:round;stroke-linejoin:round" />
<path
d="m 176.833,59.733 c -0.268,0 -0.531,-0.077 -0.757,-0.222 -0.225,-0.145 -0.405,-0.352 -0.516,-0.596 -0.112,-0.244 -0.151,-0.515 -0.112,-0.781 0.038,-0.266 0.152,-0.515 0.327,-0.717 0.176,-0.203 0.406,-0.351 0.664,-0.427 0.257,-0.076 0.531,-0.076 0.789,0 0.257,0.076 0.488,0.224 0.663,0.427 0.176,0.202 0.29,0.451 0.328,0.717 0.038,0.266 -0.001,0.537 -0.112,0.781 -0.112,0.244 -0.291,0.451 -0.517,0.596 -0.226,0.145 -0.488,0.222 -0.757,0.222 z"
stroke="#0000ff"
stroke-width="0.2"
id="path705"
style="fill:none;stroke-linecap:round;stroke-linejoin:round" />
<g
id="p-7"
style="fill:none;stroke-linecap:round;stroke-linejoin:round;">
<path
d="M 183.068 41.200 H 189.668 C 189.768 41.200 189.668 41.100 189.668 41.200 V 46.900 C 189.668 46.955 189.713 47.000 189.768 47.000 H 201.368 C 201.423 47.000 201.468 46.955 201.468 46.900 V 41.200 C 201.468 41.100 201.368 41.200 201.468 41.200 H 208.068 C 208.123 41.200 208.168 41.155 208.168 41.100 V 34.500 C 208.168 34.400 208.068 34.500 208.168 34.500 H 213.868 C 213.923 34.500 213.968 34.455 213.968 34.400 V 22.800 C 213.968 22.745 213.923 22.700 213.868 22.700 H 208.168 C 208.068 22.700 208.168 22.800 208.168 22.700 V 16.100 C 208.168 16.045 208.123 16.000 208.068 16.000 C 208.042 16.000 208.016 16.011 207.997 16.029 L 182.997 41.029 C 182.979 41.048 182.968 41.073 182.968 41.100 C 182.968 41.155 183.013 41.200 183.068 41.200 Z"
stroke="rgb(0,0,0)"
stroke-width="0.20"
id="path708" />
<path
d="M 199.735 31.867 C 199.907 31.867 200.076 31.916 200.221 32.010 C 200.367 32.103 200.482 32.236 200.553 32.393 C 200.625 32.550 200.650 32.724 200.626 32.895 C 200.601 33.066 200.528 33.226 200.415 33.356 C 200.302 33.486 200.154 33.582 199.988 33.630 C 199.823 33.679 199.647 33.679 199.481 33.630 C 199.316 33.582 199.168 33.486 199.055 33.356 C 198.942 33.226 198.869 33.066 198.844 32.895 C 198.819 32.724 198.844 32.550 198.916 32.393 C 198.988 32.236 199.103 32.103 199.248 32.010 C 199.393 31.916 199.562 31.867 199.735 31.867 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path710" />
<path
d="M 199.300 15.800 H 192.700 C 192.600 15.800 192.700 15.900 192.700 15.800 V 10.100 C 192.700 10.045 192.655 10.000 192.600 10.000 H 181.000 C 180.945 10.000 180.900 10.045 180.900 10.100 V 15.800 C 180.900 15.900 181.000 15.800 180.900 15.800 H 174.300 C 174.245 15.800 174.200 15.845 174.200 15.900 V 22.500 C 174.200 22.600 174.300 22.500 174.200 22.500 H 168.500 C 168.445 22.500 168.400 22.545 168.400 22.600 V 34.200 C 168.400 34.255 168.445 34.300 168.500 34.300 H 174.200 C 174.300 34.300 174.200 34.200 174.200 34.300 V 40.900 C 174.200 40.955 174.245 41.000 174.300 41.000 C 174.327 41.000 174.352 40.989 174.371 40.971 L 199.371 15.971 C 199.389 15.952 199.400 15.927 199.400 15.900 C 199.400 15.845 199.355 15.800 199.300 15.800 Z"
stroke="rgb(0,0,0)"
stroke-width="0.20"
id="path712" />
<path
d="M 182.633 25.133 C 182.461 25.133 182.292 25.084 182.147 24.990 C 182.002 24.897 181.886 24.764 181.815 24.607 C 181.743 24.450 181.718 24.276 181.742 24.105 C 181.767 23.934 181.840 23.774 181.953 23.644 C 182.066 23.514 182.214 23.418 182.380 23.370 C 182.545 23.321 182.721 23.321 182.887 23.370 C 183.052 23.418 183.201 23.514 183.314 23.644 C 183.426 23.774 183.500 23.934 183.524 24.105 C 183.549 24.276 183.524 24.450 183.452 24.607 C 183.380 24.764 183.265 24.897 183.120 24.990 C 182.975 25.084 182.806 25.133 182.633 25.133 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path714" />
<path
d="M 231.536 41.200 H 238.136 C 238.236 41.200 238.136 41.100 238.136 41.200 V 46.900 C 238.136 46.955 238.181 47.000 238.236 47.000 H 249.836 C 249.891 47.000 249.936 46.955 249.936 46.900 V 41.200 C 249.936 41.100 249.836 41.200 249.936 41.200 H 256.536 C 256.591 41.200 256.636 41.155 256.636 41.100 V 34.500 C 256.636 34.400 256.536 34.500 256.636 34.500 H 262.336 C 262.391 34.500 262.436 34.455 262.436 34.400 V 22.800 C 262.436 22.745 262.391 22.700 262.336 22.700 H 256.636 C 256.536 22.700 256.636 22.800 256.636 22.700 V 16.100 C 256.636 16.045 256.591 16.000 256.536 16.000 C 256.510 16.000 256.484 16.011 256.466 16.029 L 231.466 41.029 C 231.447 41.048 231.436 41.073 231.436 41.100 C 231.436 41.155 231.481 41.200 231.536 41.200 Z"
stroke="rgb(0,0,0)"
stroke-width="0.20"
id="path716" />
<path
d="M 248.203 31.867 C 248.375 31.867 248.544 31.916 248.689 32.010 C 248.835 32.103 248.950 32.236 249.022 32.393 C 249.093 32.550 249.118 32.724 249.094 32.895 C 249.069 33.066 248.996 33.226 248.883 33.356 C 248.770 33.486 248.622 33.582 248.456 33.630 C 248.291 33.679 248.115 33.679 247.949 33.630 C 247.784 33.582 247.636 33.486 247.523 33.356 C 247.410 33.226 247.337 33.066 247.312 32.895 C 247.288 32.724 247.313 32.550 247.384 32.393 C 247.456 32.236 247.571 32.103 247.716 32.010 C 247.861 31.916 248.030 31.867 248.203 31.867 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path718" />
<path
d="M 247.768 15.800 H 241.168 C 241.068 15.800 241.168 15.900 241.168 15.800 V 10.100 C 241.168 10.045 241.123 10.000 241.068 10.000 H 229.468 C 229.413 10.000 229.368 10.045 229.368 10.100 V 15.800 C 229.368 15.900 229.468 15.800 229.368 15.800 H 222.768 C 222.713 15.800 222.668 15.845 222.668 15.900 V 22.500 C 222.668 22.600 222.768 22.500 222.668 22.500 H 216.968 C 216.913 22.500 216.868 22.545 216.868 22.600 V 34.200 C 216.868 34.255 216.913 34.300 216.968 34.300 H 222.668 C 222.768 34.300 222.668 34.200 222.668 34.300 V 40.900 C 222.668 40.955 222.713 41.000 222.768 41.000 C 222.795 41.000 222.820 40.989 222.839 40.971 L 247.839 15.971 C 247.858 15.952 247.868 15.927 247.868 15.900 C 247.868 15.845 247.823 15.800 247.768 15.800 Z"
stroke="rgb(0,0,0)"
stroke-width="0.20"
id="path720" />
<path
d="M 231.101 25.133 C 230.929 25.133 230.760 25.084 230.615 24.990 C 230.470 24.897 230.354 24.764 230.283 24.607 C 230.211 24.450 230.186 24.276 230.211 24.105 C 230.235 23.934 230.308 23.774 230.421 23.644 C 230.534 23.514 230.682 23.418 230.848 23.370 C 231.013 23.321 231.189 23.321 231.355 23.370 C 231.521 23.418 231.669 23.514 231.782 23.644 C 231.895 23.774 231.968 23.934 231.992 24.105 C 232.017 24.276 231.992 24.450 231.920 24.607 C 231.848 24.764 231.733 24.897 231.588 24.990 C 231.443 25.084 231.274 25.133 231.101 25.133 Z"
stroke="rgb(0,0,255)"
stroke-width="0.20"
id="path722" />
</g>
<g
id="g2792"
transform="translate(164.86593,66.330864)">
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.197531;stroke-linejoin:bevel"
id="circle356"
cx="-96.978889"
cy="67.045097"
r="7.9012341" />
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.197531;stroke-linejoin:bevel"
id="circle358"
cx="-132.00597"
cy="67.045013"
r="7.9012341" />
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.197531;stroke-linejoin:bevel"
id="circle414"
cx="-21.925894"
cy="67.045013"
r="7.9012341" />
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.197531;stroke-linejoin:bevel"
id="circle482"
cx="-56.952888"
cy="67.045013"
r="7.9012341" />
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.197531;stroke-linejoin:bevel"
id="circle1096"
cx="-21.925894"
cy="30.003345"
r="7.9012341" />
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.197531;stroke-linejoin:bevel"
id="circle1098"
cx="-56.952888"
cy="30.003345"
r="7.9012341" />
<g
id="g1102"
transform="translate(-258.63397,-45.905282)">
<circle
style="fill:none;stroke:#ff0000;stroke-width:0.247524;stroke-linejoin:bevel;stroke-opacity:1"
id="path1204"
cx="161.65508"
cy="75.908714"
r="12.376238" />
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.140845;stroke-linejoin:bevel;stroke-opacity:1"
id="path1242"
cx="161.65508"
cy="75.908714"
r="4.9295774" />
</g>
<g
id="g1106"
transform="translate(-124.02175,-16.625901)">
<rect
style="fill:none;stroke:#ff0000;stroke-width:0.2;stroke-linejoin:bevel;stroke-opacity:1"
id="rect1124"
width="14"
height="30"
x="-14.98422"
y="32.953976" />
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.196722;stroke-linejoin:bevel"
id="path1126"
cx="-7.98422"
cy="47.953976"
r="5.9016395" />
</g>
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.118812;stroke-linejoin:bevel"
id="path442"
cx="-48.504658"
cy="-4.9068246"
r="5.9405942" />
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.118812;stroke-linejoin:bevel"
id="circle1108"
cx="-20.878468"
cy="-4.9068246"
r="5.9405942" />
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.118812;stroke-linejoin:bevel"
id="circle1110"
cx="-132.97075"
cy="-4.9068246"
r="5.9405942" />
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.118812;stroke-linejoin:bevel"
id="circle1112"
cx="-105.87373"
cy="-4.9068246"
r="5.9405942" />
<circle
style="fill:none;stroke:#0000ff;stroke-width:0.118812;stroke-linejoin:bevel"
id="circle1114"
cx="-77.189186"
cy="-4.9068246"
r="5.9405942" />
</g>
</svg>
/*
* A simple control panel for kids of all ages to play with.
* Built from WS2811 pixels and excess switches, buttons, and knobs from the ewaste bins!
* Written by Dana Sniezko, Spring 2023.
*
*/
#include <FastLED.h>
FASTLED_USING_NAMESPACE
// define all buttons
#define R_BTN 13
#define G_BTN 12
#define B_BTN 14
#define Y_BTN 27
#define U_BTN 26
#define D_BTN 25
#define KNOB 34
// LED SETUP
#define LED_PIN 15
#define LED_TYPE WS2811
#define COLOR_ORDER RGB
#define NUM_LEDS 5
CRGB leds[NUM_LEDS];
#define BRIGHTNESS 96
#define FRAMES_PER_SECOND 100
#define GHUE_LONG 1000
int currentPattern = 0;
int gHueDelay = 30;
int pins[] = {R_BTN,G_BTN,B_BTN,Y_BTN,U_BTN,D_BTN};
int pinNum = -1;
unsigned long lastDebounceTime = 0; // the last time the output pin was toggled
unsigned long debounceDelay = 75; // the debounce time; increase if the output flickers
int potValue = 30;
unsigned long lastStep = 0;
void setup() {
delay(20); // 200 ms delay
// tell FastLED about the LED strip configuration
FastLED.addLeds<LED_TYPE,LED_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
// set master brightness control
FastLED.setBrightness(BRIGHTNESS);
Serial.begin(115200);
Serial.println("Here we go!");
// setup buttons with internal pull up resistor
pinMode(R_BTN, INPUT_PULLUP); // R
pinMode(G_BTN, INPUT_PULLUP); // G
pinMode(B_BTN, INPUT_PULLUP); // B
pinMode(Y_BTN, INPUT_PULLUP); // Y
pinMode(U_BTN, INPUT_PULLUP); // +
pinMode(D_BTN, INPUT_PULLUP); // -
}
typedef void (*SimplePatternList[])();
SimplePatternList gPatterns = { rainbow, rainbowWithGlitter, confetti, sinelon, juggle, bpm };
uint8_t gCurrentPatternNumber = 0; // Index number of which pattern is current
uint8_t gHue = 0; // rotating "base color" used by many of the patterns
void loop() {
// current time
unsigned long currentMillis = millis(); // Update current time
// do button check behavior
if ((currentMillis - lastDebounceTime) > debounceDelay) {
pinNum = checkPins(pins);
if(pinNum != -1) {
Serial.print("You pressed button on pin: ");
Serial.println(pinNum);
lastDebounceTime = currentMillis;
}
}
// set the pattern
choosePattern(pinNum);
gPatterns[currentPattern]();
//Serial.print("Current Pattern:");
//Serial.println(currentPattern);
// send the 'leds' array out to the actual LED strip
FastLED.show();
// insert a delay to keep the framerate modest
FastLED.delay(1000/FRAMES_PER_SECOND);
potValue= filter(potValue,map(analogRead(KNOB), 0, 4095, 10, 60));
//Serial.print("Knob says:");
//Serial.println(potValue);
if(currentPattern == 3) {
EVERY_N_MILLISECONDS( 1000 ) { gHue++; }
} else {
EVERY_N_MILLISECONDS( potValue ) { gHue++; } // slowly cycle the "base color" through the rainbow
}
}
#define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))
void nextPattern()
{
// add one to the current pattern number, and wrap around at the end
currentPattern = (currentPattern + 1) % ARRAY_SIZE( gPatterns);
}
void choosePattern(int pin) {
switch (pin) {
case D_BTN:
currentPattern = 0; // Rainbow-enhanced theaterChase variant
break;
case U_BTN:
nextPattern(); // Flowing rainbow cycle along the whole strip
break;
case R_BTN:
gHue = 0;
currentPattern = 3;
break;
case Y_BTN:
gHue = 60;
currentPattern = 3;
break;
case B_BTN:
gHue = 155;
currentPattern = 3;
break;
case G_BTN:
gHue = 95;
currentPattern = 3;
break;
default:
break;
}
}
int checkPins(int pins[]) {
for (int i = 0; i < 6; i++) {
if (digitalRead(pins[i]) == LOW) {
return pins[i];
}
}
return -1;
}
int filter(int oldVal,int newVal) {
if (abs(oldVal-newVal) > 4) {
return newVal;
} else {
return oldVal;
}
}
void rainbow()
{
// FastLED's built-in rainbow generator
fill_rainbow( leds, NUM_LEDS, gHue, 7);
}
void rainbowWithGlitter()
{
// built-in FastLED rainbow, plus some random sparkly glitter
rainbow();
addGlitter(20);
}
void addGlitter( fract8 chanceOfGlitter)
{
if( random8() < chanceOfGlitter) {
leds[ random16(NUM_LEDS) ] += CRGB::White;
}
}
void confetti()
{
// random colored speckles that blink in and fade smoothly
fadeToBlackBy( leds, NUM_LEDS, 10);
int pos = random16(NUM_LEDS);
leds[pos] += CHSV( gHue + random8(64), 200, 255);
}
void sinelon()
{
// a colored dot sweeping back and forth, with fading trails
fadeToBlackBy( leds, NUM_LEDS, 20);
int pos = beatsin16(potValue, 0, NUM_LEDS-1 );
leds[pos] += CHSV( gHue, 255, 192);
}
void bpm()
{
// colored stripes pulsing at a defined Beats-Per-Minute (BPM)
uint8_t BeatsPerMinute = 62;
CRGBPalette16 palette = PartyColors_p;
uint8_t beat = beatsin8( BeatsPerMinute, 64, 255);
for( int i = 0; i < NUM_LEDS; i++) { //9948
leds[i] = ColorFromPalette(palette, gHue+(i*2), beat-gHue+(i*10));
}
}
void juggle() {
// eight colored dots, weaving in and out of sync with each other
fadeToBlackBy( leds, NUM_LEDS, 20);
byte dothue = 0;
for( int i = 0; i < 8; i++) {
leds[beatsin16( i+7, 0, NUM_LEDS-1 )] |= CHSV(dothue, 200, 255);
dothue += 32;
}
}
int checkButtons() {
for(int i=0; i < 5; i++) {
boolean buttonState = digitalRead(i);
if(buttonState) {
return i;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment