This commit is contained in:
ivan 2022-06-28 14:40:08 +03:00
parent 6071ba3b24
commit 50e539afa7
8 changed files with 1012 additions and 1 deletions

View File

@ -1,3 +1,8 @@
# toneroulette
Educational game for children: "Guess The Note" based on Arudino, buzzer, RGB LED, servo and rotary encoder
Educational game for children: "Guess The Note" based on Arudino, buzzer, RGB LED, servo and rotary encoder
![toneroulette](https://dev.ussr.win/microcontrollers/toneroulette/raw/branch/master/toneroulette_agg.jpg)
![toneroulette](https://dev.ussr.win/microcontrollers/toneroulette/raw/branch/master/toneroulette_bb.jpg)

537
barrel.svg Normal file
View File

@ -0,0 +1,537 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="297mm"
viewBox="0 0 210 297"
version="1.1"
id="svg8"
sodipodi:docname="barrel.svg"
inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
inkscape:export-filename="/home/feder/bitmap.png"
inkscape:export-xdpi="190.02963"
inkscape:export-ydpi="190.02963">
<defs
id="defs2">
<rect
x="102.37154"
y="58.797257"
width="19.673576"
height="28.400667"
id="rect1317" />
<rect
x="102.86595"
y="58.074068"
width="17.262081"
height="22.162882"
id="rect1295" />
<rect
x="102.37154"
y="58.797256"
width="19.673576"
height="28.400667"
id="rect1317-8" />
<rect
x="102.37154"
y="58.797256"
width="19.673576"
height="28.400667"
id="rect1336" />
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter1371"
x="-0.0039488089"
width="1.0078976"
y="-0.0033078121"
height="1.0066156">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.029265564"
id="feGaussianBlur1373" />
</filter>
<rect
x="102.37154"
y="58.797256"
width="19.673576"
height="28.400667"
id="rect1317-8-9" />
<rect
x="102.37154"
y="58.797256"
width="19.673576"
height="28.400667"
id="rect1384" />
<rect
x="102.37154"
y="58.797256"
width="19.673576"
height="28.400667"
id="rect1317-8-5" />
<rect
x="102.37154"
y="58.797256"
width="19.673576"
height="28.400667"
id="rect1384-2" />
<rect
x="102.37154"
y="58.797256"
width="19.673576"
height="28.400667"
id="rect1317-8-2" />
<rect
x="102.37154"
y="58.797256"
width="19.673576"
height="28.400667"
id="rect1384-6" />
<rect
x="102.37154"
y="58.797256"
width="19.673576"
height="28.400667"
id="rect1317-8-5-6" />
<rect
x="102.37154"
y="58.797256"
width="19.673576"
height="28.400667"
id="rect1489" />
<rect
x="102.37154"
y="58.797256"
width="35.164084"
height="29.567182"
id="rect1317-8-5-62" />
<rect
x="102.37154"
y="58.797256"
width="19.673576"
height="28.400667"
id="rect1489-4" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="599.26614"
inkscape:cy="673.23808"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="false"
inkscape:window-width="1280"
inkscape:window-height="1007"
inkscape:window-x="1280"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<circle
style="fill:#cccccc;fill-rule:evenodd;stroke-width:0.264583"
id="path10"
cx="112.5"
cy="127"
r="80"
sodipodi:insensitive="true" />
<circle
style="fill:#333333;stroke-width:0.921539"
id="path863"
sodipodi:type="arc"
sodipodi:cx="75.855179"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="0"
sodipodi:end="0.52359878"
sodipodi:arc-type="slice"
d="m 153.35902,151.64351 a 77.503838,77.503838 0 0 1 -10.38355,38.75192 L 75.855179,151.64351 Z"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#e6e6e6;stroke-width:0.921539"
id="path863-8"
sodipodi:type="arc"
sodipodi:cx="75.855179"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="5.7595865"
sodipodi:end="0"
sodipodi:arc-type="slice"
d="m 142.97547,112.89159 a 77.503838,77.503838 0 0 1 10.38355,38.75192 H 75.855179 Z"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#333333;stroke-width:0.923732"
id="path863-7"
sodipodi:type="arc"
sodipodi:cx="75.855179"
sodipodi:cy="151.64351"
sodipodi:rx="77.873207"
sodipodi:ry="77.503838"
sodipodi:start="5.2359878"
sodipodi:end="5.7595865"
sodipodi:arc-type="slice"
d="m 114.79179,84.523218 a 77.873207,77.503838 0 0 1 28.50356,28.368372 l -67.440171,38.75192 z"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#333333;stroke-width:0.921539"
id="path863-85"
sodipodi:type="arc"
sodipodi:cx="75.855179"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="4.1887902"
sodipodi:end="4.712389"
sodipodi:arc-type="slice"
d="M 37.10326,84.523217 A 77.503838,77.503838 0 0 1 75.855179,74.139671 v 77.503839 z"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#333333;stroke-width:0.921539"
id="path863-4"
sodipodi:type="arc"
sodipodi:cx="75.855179"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="3.1415927"
sodipodi:end="3.6651914"
sodipodi:arc-type="slice"
d="M -1.6486588,151.64351 A 77.503838,77.503838 0 0 1 8.7348855,112.89159 l 67.1202935,38.75192 z"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#e6e6e6;stroke-width:0.921539"
id="path863-8-5"
sodipodi:type="arc"
sodipodi:cx="76.175064"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="4.712389"
sodipodi:end="5.2359878"
sodipodi:arc-type="slice"
d="M 76.175064,74.139671 A 77.503838,77.503838 0 0 1 114.92699,84.523218 L 76.175064,151.64351 Z"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#e6e6e6;stroke-width:0.921539"
id="path863-8-8"
sodipodi:type="arc"
sodipodi:cx="76.175064"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="3.6651914"
sodipodi:end="4.1887902"
sodipodi:arc-type="slice"
d="M 9.0547707,112.89159 A 77.503838,77.503838 0 0 1 37.423145,84.523217 l 38.751919,67.120293 z"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#666666;stroke-width:0.921539"
id="path863-8-6"
sodipodi:type="arc"
sodipodi:cx="75.855179"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="5.7595865"
sodipodi:end="0"
sodipodi:arc-type="chord"
d="m 142.97547,112.89159 a 77.503838,77.503838 0 0 1 10.38355,38.75192 z"
sodipodi:open="true"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#666666;stroke-width:0.921539"
id="path863-8-5-6"
sodipodi:type="arc"
sodipodi:cx="76.039864"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="4.712389"
sodipodi:end="5.2359878"
sodipodi:arc-type="chord"
d="M 76.039864,74.139671 A 77.503838,77.503838 0 0 1 114.79179,84.523218 Z"
sodipodi:open="true"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#666666;stroke-width:0.921539"
id="path863-8-8-3"
sodipodi:type="arc"
sodipodi:cx="76.175064"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="3.6651914"
sodipodi:end="4.1887902"
sodipodi:arc-type="chord"
d="M 9.0547707,112.89159 A 77.503838,77.503838 0 0 1 37.423145,84.523217 Z"
sodipodi:open="true"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#4d4d4d;stroke-width:0.921539"
id="path863-72"
sodipodi:type="arc"
sodipodi:cx="75.855179"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="0"
sodipodi:end="0.52359878"
sodipodi:arc-type="chord"
d="m 153.35902,151.64351 a 77.503838,77.503838 0 0 1 -10.38355,38.75192 z"
sodipodi:open="true"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#666666;stroke-width:0.923732"
id="path863-7-2"
sodipodi:type="arc"
sodipodi:cx="75.990379"
sodipodi:cy="151.64351"
sodipodi:rx="77.873207"
sodipodi:ry="77.503838"
sodipodi:start="5.2359878"
sodipodi:end="5.7595865"
sodipodi:arc-type="chord"
d="m 114.92699,84.523218 a 77.873207,77.503838 0 0 1 28.50356,28.368372 z"
sodipodi:open="true"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#666666;stroke-width:0.921539"
id="path863-85-5"
sodipodi:type="arc"
sodipodi:cx="76.175064"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="4.1887902"
sodipodi:end="4.712389"
sodipodi:arc-type="chord"
d="M 37.423145,84.523217 A 77.503838,77.503838 0 0 1 76.175064,74.139671 Z"
sodipodi:open="true"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#666666;stroke-width:0.921539"
id="path863-4-5"
sodipodi:type="arc"
sodipodi:cx="75.855179"
sodipodi:cy="151.64351"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="3.1415927"
sodipodi:end="3.6651914"
sodipodi:arc-type="chord"
d="M -1.6486588,151.64351 A 77.503838,77.503838 0 0 1 8.7348855,112.89159 Z"
sodipodi:open="true"
transform="rotate(-15)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<text
xml:space="preserve"
id="text1315"
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1317);fill:#e6e6e6;fill-opacity:1;stroke:none;filter:url(#filter1371);"
x="8.9477463"
y="0"
transform="rotate(-90,114.48492,125.01285)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313"><tspan
x="102.99671"
y="68.160615"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle;fill:#e6e6e6">ДО </tspan></tspan><tspan
x="108.32454"
y="81.389741"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle;fill:#e6e6e6">C</tspan></tspan></text>
<text
xml:space="preserve"
id="text1315-5"
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1317-8);fill:#e6e6e6;fill-opacity:1;stroke:none;"
x="8.9477463"
y="0"
transform="rotate(-30,124.36985,125.32297)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313"><tspan
x="102.51354"
y="68.160615"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle;fill:#e6e6e6">МИ </tspan></tspan><tspan
x="108.59325"
y="81.389741"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle;fill:#e6e6e6">E</tspan></tspan></text>
<text
xml:space="preserve"
id="text1315-5-8"
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1317-8-9);fill:#000000;fill-opacity:1;stroke:none;"
x="8.9477463"
y="0"
transform="rotate(-60,117.77986,124.80921)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313"><tspan
x="104.71495"
y="68.160615"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle">РЕ </tspan></tspan><tspan
x="107.81553"
y="81.389741"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle">D</tspan></tspan></text>
<text
xml:space="preserve"
id="text1315-5-0"
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1317-8-5);fill:#000000;fill-opacity:1;stroke:none;"
x="8.9477463"
y="0"
transform="translate(0.0550113,8.5196754)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313"><tspan
x="102.86494"
y="68.160615"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle">ФА </tspan></tspan><tspan
x="108.59325"
y="81.389741"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle">F</tspan></tspan></text>
<text
xml:space="preserve"
id="text1315-5-2"
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1317-8-2);fill:#000000;fill-opacity:1;stroke:none;"
x="8.9477463"
y="0"
transform="rotate(60,107.0215,124.70427)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313"><tspan
x="103.73827"
y="68.160615"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle">ЛЯ </tspan></tspan><tspan
x="108.11266"
y="81.389741"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle">A</tspan></tspan></text>
<text
xml:space="preserve"
id="text1315-5-0-2"
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1317-8-5-6);fill:#e6e6e6;fill-opacity:1;stroke:none;"
x="8.9477463"
y="0"
transform="rotate(90,109.01627,123.33367)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313"><tspan
x="103.89588"
y="68.160615"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle;fill:#e6e6e6">СИ </tspan></tspan><tspan
x="108.17468"
y="81.389741"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.5833px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle;fill:#e6e6e6">B</tspan></tspan></text>
<text
xml:space="preserve"
id="text1315-5-0-8"
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1317-8-5-62);fill:#e6e6e6;fill-opacity:1;stroke:none;"
x="8.9477463"
y="0"
transform="rotate(30,103.8382,110.03236)"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313"><tspan
x="105.38416"
y="68.160615"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:9.17222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle;fill:#e6e6e6">СОЛЬ </tspan></tspan><tspan
x="116.18884"
y="81.389741"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:9.17222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;text-anchor:middle;fill:#e6e6e6">G</tspan></tspan></text>
<path
d="m 131.24283,144.32911 c -20.16811,-0.5667 -36.687408,5.71934 -36.687408,5.71934 l -0.01206,31.90022 c -2.053475,-0.68879 -4.550633,-0.85208 -7.086925,-0.33118 -5.468106,1.12272 -9.048894,4.99546 -7.997776,8.65151 1.05112,3.65604 6.33561,5.71018 11.803115,4.58799 5.155661,-1.05862 8.631697,-4.56256 8.131419,-8.02326 v -23.83524 c 0,0 11.681505,-3.45105 26.833645,-4.31634 v 17.72776 c -2.03121,-0.65724 -4.48081,-0.80629 -6.97075,-0.29505 -5.4681,1.12221 -9.04889,4.99496 -7.99777,8.6515 1.05051,3.65604 6.33501,5.70969 11.80311,4.58749 4.77459,-0.98028 8.10975,-4.05793 8.17958,-7.25613 l 0.002,0.002 z"
fill="#000000"
id="path1676"
style="stroke-width:0.553395"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<circle
style="fill:#e6e6e6;stroke-width:0.921539"
id="path863-8-5-4"
sodipodi:type="arc"
sodipodi:cx="-262.00809"
sodipodi:cy="87.914368"
sodipodi:rx="77.503838"
sodipodi:ry="77.503838"
sodipodi:start="4.712389"
sodipodi:end="5.2359878"
sodipodi:arc-type="slice"
transform="rotate(-105)"
d="m -262.00809,10.41053 a 77.503838,77.503838 0 0 1 38.75192,10.383547 l -38.75192,67.120291 z"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
<path
d="m 104.84436,237.2632 c 0.22608,-7.12287 -2.2817,-12.95706 -2.2817,-12.95706 l -12.726413,-0.004 c 0.2748,-0.72525 0.33993,-1.60717 0.13212,-2.50293 -0.4479,-1.93119 -1.9929,-3.19584 -3.45146,-2.82461 -1.45856,0.37123 -2.27805,2.23758 -1.83036,4.16856 0.42233,1.82085 1.82021,3.0485 3.20084,2.87182 h 9.50894 c 0,0 1.37677,4.12561 1.72198,9.47696 h -7.0724 c 0.2622,-0.71737 0.32167,-1.58251 0.11774,-2.46189 -0.4477,-1.93119 -1.99271,-3.19584 -3.45148,-2.82461 -1.45855,0.37101 -2.27785,2.23737 -1.83014,4.16856 0.39107,1.68626 1.61888,2.86416 2.89478,2.88882 l -7.9e-4,7e-4 z"
fill="#000000"
id="path1676-4"
style="stroke-width:0.207724"
inkscape:export-filename="/home/feder/path863.png"
inkscape:export-xdpi="278.46313"
inkscape:export-ydpi="278.46313" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 24 KiB

95
pitches.h Normal file
View File

@ -0,0 +1,95 @@
/*************************************************
* Public Constants
*************************************************/
#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
#define NOTE_G1 49
#define NOTE_GS1 52
#define NOTE_A1 55
#define NOTE_AS1 58
#define NOTE_B1 62
#define NOTE_C2 65
#define NOTE_CS2 69
#define NOTE_D2 73
#define NOTE_DS2 78
#define NOTE_E2 82
#define NOTE_F2 87
#define NOTE_FS2 93
#define NOTE_G2 98
#define NOTE_GS2 104
#define NOTE_A2 110
#define NOTE_AS2 117
#define NOTE_B2 123
#define NOTE_C3 131
#define NOTE_CS3 139
#define NOTE_D3 147
#define NOTE_DS3 156
#define NOTE_E3 165
#define NOTE_F3 175
#define NOTE_FS3 185
#define NOTE_G3 196
#define NOTE_GS3 208
#define NOTE_A3 220
#define NOTE_AS3 233
#define NOTE_B3 247
#define NOTE_C4 262
#define NOTE_CS4 277
#define NOTE_D4 294
#define NOTE_DS4 311
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_FS4 370
#define NOTE_G4 392
#define NOTE_GS4 415
#define NOTE_A4 440
#define NOTE_AS4 466
#define NOTE_B4 494
#define NOTE_C5 523
#define NOTE_CS5 554
#define NOTE_D5 587
#define NOTE_DS5 622
#define NOTE_E5 659
#define NOTE_F5 698
#define NOTE_FS5 740
#define NOTE_G5 784
#define NOTE_GS5 831
#define NOTE_A5 880
#define NOTE_AS5 932
#define NOTE_B5 988
#define NOTE_C6 1047
#define NOTE_CS6 1109
#define NOTE_D6 1175
#define NOTE_DS6 1245
#define NOTE_E6 1319
#define NOTE_F6 1397
#define NOTE_FS6 1480
#define NOTE_G6 1568
#define NOTE_GS6 1661
#define NOTE_A6 1760
#define NOTE_AS6 1865
#define NOTE_B6 1976
#define NOTE_C7 2093
#define NOTE_CS7 2217
#define NOTE_D7 2349
#define NOTE_DS7 2489
#define NOTE_E7 2637
#define NOTE_F7 2794
#define NOTE_FS7 2960
#define NOTE_G7 3136
#define NOTE_GS7 3322
#define NOTE_A7 3520
#define NOTE_AS7 3729
#define NOTE_B7 3951
#define NOTE_C8 4186
#define NOTE_CS8 4435
#define NOTE_D8 4699
#define NOTE_DS8 4978

View File

@ -0,0 +1,187 @@
#include "pitches.h" // загрузить ноты из pitches.h
#include "Servo.h" // загрузить стандартную библиотеку Servo.h
Servo myservo; // создать объект сервопривода myservo для его контроя
const int redLED = 4; // красный пин светодиода
const int greenLED = 5; // зелёный пин светодиода
const int blueLED = 6; // синий пин светодиода
const int buzzer = 7; // сигнальный пин пищалки
const int servo = 9; // контрольный пин сервопривода
const int encDT = 2; // пин правого поворота (DT) поворотного регулятора
const int encCLK = 3; // пин левого поворота (CLK) поворотного регулятора
const int encSW = 8; // пин нажатия (SW) поворотного регулятора
volatile unsigned int encPos = 32768; // счётчик позиции поворотного регулятора
unsigned int lastReportedPos = 32768; // последнее записанное значение позиции поворотного регулятора
static boolean rotating = false; // управление поворотом регулятора
boolean right_set = false; // переменная процедуры правого поворота регулятора
boolean left_set = false; // переменная процедуры левого поворота регулятора
int pos = 0; // переменная позиции сервопривода
int posnote = 0; // переменная ноты на которую указывает сервопривод
int playednote = 0; // переменная хранящая последнюю сыгранную ноту
int gamma[] = {NOTE_B3, NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4, NOTE_A4, NOTE_B4, NOTE_C5}; // си3-до5
void setup() { // функция выполняемая при запуске
Serial.begin(9600); // инициализация серийного монитора
pinMode(LED_BUILTIN, OUTPUT); // определение встроенного светодиода
digitalWrite(LED_BUILTIN, LOW); // выключить встроенный светодиод подав напряжение низкого уровня
pinMode(buzzer, OUTPUT); // определение пищалки на выходной сигнал
pinMode(encDT, INPUT_PULLUP); // определение правого поворота регулятора на вход с подтягивающим резистором
pinMode(encCLK, INPUT_PULLUP); // определение левого поворота регулятора на вход с подтягивающим резистором
pinMode(encSW, INPUT_PULLUP); // определение нажатия регулятора на вход с подтягивающим резистором
attachInterrupt(0, encRight, CHANGE); // контакт регулятора на прерывании 0 (право)
attachInterrupt(1, encLeft, CHANGE); // контакт регулятора на прерывании 1 (лево)
// randomSeed(analogRead(0)); // устновка случайного семени в зависимости от напряжения на незанетом пине
initAll(); // вызов функции иниализации пищалки, светодиода и севпривода
randomNote(); // вызов функции проигрывания случайной ноты
}
void loop() { // функция выполняемая постоянно
rotating = true; // указание состояния поворота регулятора
if (lastReportedPos != encPos) { // если последнее записанное значение поворота регулятора неравно нынешнему положению
// Serial.print("POS:"); Serial.print(pos); Serial.print("IN:"); Serial.println(encPos, DEC); // вывод значений для отладки
if (lastReportedPos < encPos) { // если последнее записанное значение поворота регулятора меньше нынешнего
if (pos > 10) rotateRight (pos, (pos-30)); // если позиция севопривода больше 10 - повернуть вправо на 30 градусов
}
if (lastReportedPos > encPos) { // если последнее записанное значение поворота регулятора больше нынешнего
if (pos < 170) rotateLeft (pos, (pos+30)); // если позиция севопривода меньше 170 - повернуть влево на 30 градусов
}
lastReportedPos = encPos; // последнему записанному значению присвоить нынешнее значение регулятора
}
if (digitalRead(encSW) == LOW ) { // если нажата кнопка
posnote = ((((pos / 30) + 1) - 8) * (-1)); // вычисление ноты на которую указывает сервопривод
// Serial.print("NOTE:"); Serial.println(posnote); // вывод значений для отладки
if (posnote == playednote) { // если сервопривод указывает на последнюю сыгранную ноту
int blinking; // объявление временной переменной мерцания светодиода
for (blinking = 0; blinking < 10; blinking += 1) { // цикл 10 шагов мерцания от 0 до 9
colourGreen(); // зелёный свет светодиода
delay(200); // задержка в 200 миллисекунд
colourBlue(); // синий свет светодиода
delay(200); // задержка в 200 миллисекунд
}
colourOff(); // выключить свечение светодиода
delay(1000); // задержка в 1000 миллисекунд
randomNote(); // вызов функции проигрывания случайной ноты
} else { // иначе
colourRed(); // красный свет светодиода
delay(1000); // задержка в 1000 миллисекунд
colourOff(); // выключить свечение светодиода
}
}
}
void colourRandom() { // функция случайного цвета светодиода
analogWrite(redLED, random(0,255)); // случайное значение красного
analogWrite(greenLED, random(0,255)); // случайное значение зелёного
analogWrite(blueLED, random(0,255)); // случайное значение синего
}
void colourRed() { // функция красного цвета светодиода
analogWrite(redLED, 255); // максимальное значение красного
analogWrite(greenLED, 0); // минимальное значение зелёного
analogWrite(blueLED, 0); // минимальное значение синего
}
void colourGreen() { // функция зелёного цвета светодиода
analogWrite(redLED, 0); // минимальное значение красного
analogWrite(greenLED, 255); // максимальное значение зелёного
analogWrite(blueLED, 0); // минимальное значение синего
}
void colourBlue() { // функция синего цвета светодиода
analogWrite(redLED, 0); // минимальное значение красного
analogWrite(greenLED, 0); // минимальное значение зелёного
analogWrite(blueLED, 255); // максимальное значение синего
}
void colourOff() { // функция отсутствия цвета светодиода
analogWrite(redLED, 0); // минимальное значение красного
analogWrite(greenLED, 0); // минимальное значение зелёного
analogWrite(blueLED, 0); // минимальное значение синего
}
void rotateLeft(int posFrom, int posTo) { // функция поворота сервопривода влево
delay(32); // подождать 32 миллисекундыы
myservo.attach(servo); // присоединиться к сервоприводу
delay(32); // подождать 32 миллисекунды
for (pos = posFrom; pos < posTo; pos += 1) { // цикл увеличения позиции с posFrom до postTo с шагом в 1 градус
myservo.write(pos); // сообщить сервоприводу переместиться в позицию pos
delay(15); // подождать 15 миллисекунд для достижения позиции
}
// Serial.print("LEFTfrom:"); Serial.print(posFrom); Serial.print("to:"); Serial.print(posTo); Serial.print("cur:"); Serial.println(pos); // вывод значений для отладки
delay(32); // подождать 32 миллисекунды
myservo.detach(); // отсоединиться от сервопривода
delay(32); // подождать 32 миллисекунды
}
void rotateRight(int posFrom, int posTo) { // функция поворота сервопривода вправо
delay(32); // подождать 32 миллисекунды
myservo.attach(servo); // присоединиться к сервоприводу
delay(32); // подождать 32 миллисекунды
for (pos = posFrom; pos > posTo; pos -= 1) { // цикл уменьшения позиции с posFrom до postTo с шагом в 1 градус
myservo.write(pos); // сообщить сервоприводу переместиться в позицию pos
delay(15); // подождать 15 миллисекунд для достижения позиции
}
// Serial.print("RIGHTfrom:"); Serial.print(posFrom); Serial.print("to:"); Serial.print(posTo); Serial.print("cur:"); Serial.println(pos); // вывод значений для отладки
delay(32); // подождать 32 миллисекунды
myservo.detach(); // отсоединиться от сервопривода
delay(32); // подождать 32 миллисекунды
}
void initAll() { // функция иниализации пищалки, светодиода и севпривода
int gammavar; // обявление временной переменной нотной гаммы
for (gammavar = 1; gammavar <= 8; gammavar += 1) { // цикл увеличение ноты от 1 до 8
colourRandom(); // случайный цвет светодиода
tone(buzzer, gamma[gammavar]); // подать на пищалку соответствующий тон гаммы
delay(200); // подождать 200 миллисекунд
noTone(buzzer); // нет больше тона на пищалке
delay(10); // подождать 10 миллисекунд
}
for (gammavar = 7; gammavar >= 1; gammavar -= 1) { // цикл уменьшения ноты от 7 до 1
colourRandom(); // случайный цвет светодиода
tone(buzzer, gamma[gammavar]); // подать на пищалку соответствующий тон гаммы
delay(200); // подождать 200 миллисекунд
noTone(buzzer); // нет больше тона на пищалке
delay(10); // подождать 10 миллисекунд
}
colourRandom(); // случайный цвет светодиода
delay(500); // подождать 500 миллисекунд
colourRandom(); // случайный цвет светодиода
rotateLeft (0, 180); // повернуть сервопривод налево на 180 градусов
colourRandom(); // случайный цвет светодиода
delay(500); // подождать 500 миллисекунд
colourRandom(); // случайный цвет светодиода
rotateRight (180, 0); // повернуть сервопривод направо на 180 градусов
colourRandom(); // случайный цвет светодиода
delay(500); // подождать 500 миллисекунд
colourRandom(); // случайный цвет светодиода
delay (1000); // подождать 1000 миллисекунд
colourOff(); // выключить свечение светодиода
}
void encRight(){ // обработка прерывния поворотного регулятора на прерывании 0 (право)
if (rotating) delay (1); // подождать миллисекунду, пока поворот не закончится
if (digitalRead(encDT) != right_set) { // если физическое значение регулятора неравно переменной процедуры правого поворота регулятора
right_set = !right_set; // изменить значение переменной процедуры правого поворота регулятора на обратное
if (right_set && !left_set) // если происходит поворот вправо и не происходит вопорота влево (для регулировки)
encPos += 1; // увеличить счётчик позиции поворотного регулятора на 1
rotating = false; // больше нет вращения до завершения постоянно выполняемой функции loop()
}
}
void encLeft(){ // обработка прерывния поворотного регулятора на прерывании 1 (лево)
if (rotating) delay (1); // подождать миллисекунду, пока поворот не закончится
if (digitalRead(encCLK) != left_set) { // если физическое значение регулятора неравно переменной процедуры левого поворота регулятора
left_set = !left_set; // изменить значение переменной процедуры левого поворота регулятора на обратное
if (left_set && !right_set) // если происходит поворот влево и не происходит вопорота вправо (для регулировки)
encPos -= 1; // уменьшить счётчик позиции поворотного регулятора на 1
rotating = false; // больше нет вращения до завершения постоянно выполняемой функции loop()
}
}
void randomNote() { // функция проигрывания случайной ноты
delay(200); // подождать 200 миллисекунд
playednote = random(1,7); // сгенерировать случайное значение от 1 до 7 для переменной хранящей последнюю сыгранную ноту
tone(buzzer, gamma[playednote]); // подать на пищалку соответствующий тон переменной хранящей последнюю сыгранную ноту
delay(2000); // подождать 2000 миллисекунд
noTone(buzzer); // нет больше тона на пищалке
delay(200); // подождать 200 миллисекунд
}

BIN
toneroulette.fzz Normal file

Binary file not shown.

187
toneroulette.ino Normal file
View File

@ -0,0 +1,187 @@
#include "pitches.h" // include tones from pitches.h
#include "Servo.h" // include pitches standard Servo.h library
Servo myservo; // create servo object to control a servo
const int redLED = 4; // red pin of LED
const int greenLED = 5; // green pin of LED
const int blueLED = 6; // blue pin of LED
const int buzzer = 7; // signal pin of buzzer
const int servo = 9; // control pin of servo
const int encDT = 2; // pin of the right rotation of encoder (DT)
const int encCLK = 3; // pin of the left rotation of encoder (CLK)
const int encSW = 8; // pin of the switch of encoder (SW)
volatile unsigned int encPos = 32768; // encoder position counter
unsigned int lastReportedPos = 32768; // the last recorded position value of encoder
static boolean rotating = false; // encoder rotation control
boolean right_set = false; // variable for the procedure of right turn of encoder
boolean left_set = false; // variable for the procedure of left turn of encoder
int pos = 0; // variable to store servo position
int posnote = 0; // variable of the note to which servo is pointing
int playednote = 0; // variable storing the last note played
int gamma[] = {NOTE_B3, NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4, NOTE_A4, NOTE_B4, NOTE_C5}; // ti3-do5
void setup() { // function performed at start-up
Serial.begin(9600); // serial monitor initialisation
pinMode(LED_BUILTIN, OUTPUT); // definition of built-in LED
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
pinMode(buzzer, OUTPUT); // definition of buzzer to output signal
pinMode(encDT, INPUT_PULLUP); // definition of right turn of encoder as input pullup
pinMode(encCLK, INPUT_PULLUP); // definition of left turn of encoder as input pullup
pinMode(encSW, INPUT_PULLUP); // definition of switch of encoder as input pullup
attachInterrupt(0, encRight, CHANGE); // encoder pin on interrupt 0 (right)
attachInterrupt(1, encLeft, CHANGE); // encoder pin on interrupt 1 (left)
// randomSeed(analogRead(0)); // setting a random seed depending on the voltage on an unswitched pin
initAll(); // call for function of the initialisation of buzzer, LED and servo
randomNote(); // call random note play function
}
void loop() { // ongoing function
rotating = true; // encoder rotating state set
if (lastReportedPos != encPos) { // if the last recorded encoder position is not equal to the current position
// Serial.print("POS:"); Serial.print(pos); Serial.print("IN:"); Serial.println(encPos, DEC); // output values for debug
if (lastReportedPos < encPos) { // if the last recorded encoder position is less than the present value
if (pos > 10) rotateRight (pos, (pos-30)); // if servo position is greater than 10 - turn right 30 degrees
}
if (lastReportedPos > encPos) { // if the last recorded encoder position is greater than the present value
if (pos < 170) rotateLeft (pos, (pos+30)); // if servo position is less than 170 - turn left 30 degrees
}
lastReportedPos = encPos; // assign current encoder position to the last recorded position
}
if (digitalRead(encSW) == LOW ) { // if encoder switch is pressed
posnote = ((((pos / 30) + 1) - 8) * (-1)); // calculating the note indicated by servo
// Serial.print("NOTE:"); Serial.println(posnote); // output values for debug
if (posnote == playednote) { // if servo points to the last played note
int blinking; // declaration of LED blinking variable
for (blinking = 0; blinking < 10; blinking += 1) { // cycle 10 blinking steps from 0 to 9
colourGreen(); // green LED light
delay(200); // 200 millisecond delay
colourBlue(); // blue LED light
delay(200); // 200 millisecond delay
}
colourOff(); // switch off LED light
delay(1000); // 1000 millisecond delay
randomNote(); // call the random note play function
} else { // else
colourRed(); // red LED light
delay(1000); // 1000 millisecond delay
colourOff(); // switch off LED light
}
}
}
void colourRandom() { // random colour LED function
analogWrite(redLED, random(0,255)); // random value of red
analogWrite(greenLED, random(0,255)); // random value of green
analogWrite(blueLED, random(0,255)); // random value of blue
}
void colourRed() { // red colour LED function
analogWrite(redLED, 255); // maximum value of red
analogWrite(greenLED, 0); // minumum value of green
analogWrite(blueLED, 0); // minumum value of blue
}
void colourGreen() { // green colour LED function
analogWrite(redLED, 0); // minumum value of red
analogWrite(greenLED, 255); // maximum value of green
analogWrite(blueLED, 0); // minumum value of blue
}
void colourBlue() { // blue colour LED function
analogWrite(redLED, 0); // minumum value of red
analogWrite(greenLED, 0); // minumum value of green
analogWrite(blueLED, 255); // maximum value of blue
}
void colourOff() { // no colour LED function
analogWrite(redLED, 0); // minumum value of red
analogWrite(greenLED, 0); // minumum value of green
analogWrite(blueLED, 0); // minumum value of blue
}
void rotateLeft(int posFrom, int posTo) { // servo's left turn function
delay(32); // 32 millisecond delay
myservo.attach(servo); // attaching to servo
delay(32); // 32 millisecond delay
for (pos = posFrom; pos < posTo; pos += 1) { // cycle of increasing position from posFrom to postTo in 1-degree increments
myservo.write(pos); // tell servo to go to position in variable pos
delay(15); // 15 millisecond delay
}
// Serial.print("LEFTfrom:"); Serial.print(posFrom); Serial.print("to:"); Serial.print(posTo); Serial.print("cur:"); Serial.println(pos); // output values for debug
delay(32); // 32 millisecond delay
myservo.detach(); // detaching from servo
delay(32); // 32 millisecond delay
}
void rotateRight(int posFrom, int posTo) { // servo's right turn function
delay(32); // 32 millisecond delay
myservo.attach(servo); // attaching to servo
delay(32); // 32 millisecond delay
for (pos = posFrom; pos > posTo; pos -= 1) { // cycle of reduction position from posFrom to postTo in 1-degree increments
myservo.write(pos); // tell servo to go to position in variable pos
delay(15); // 15 millisecond delay
}
// Serial.print("RIGHTfrom:"); Serial.print(posFrom); Serial.print("to:"); Serial.print(posTo); Serial.print("cur:"); Serial.println(pos); // output values for debug
delay(32); // 32 millisecond delay
myservo.detach(); // detaching from servo
delay(32); // 32 millisecond delay
}
void initAll() { // function of the initialisation of buzzer, LED and servo
int gammavar; // declaration of temporary gamma variable
for (gammavar = 1; gammavar <= 8; gammavar += 1) { // note increase cycle from 1 to 8
colourRandom(); // random LED light
tone(buzzer, gamma[gammavar]); // sending the appropriate tone to buzzer
delay(200); // 200 millisecond delay
noTone(buzzer); // no more tone on buzzer
delay(10); // 10 millisecond delay
}
for (gammavar = 7; gammavar >= 1; gammavar -= 1) { // note decrease cycle from 7 to 1
colourRandom(); // random LED light
tone(buzzer, gamma[gammavar]); // sending the appropriate tone to buzzer
delay(200); // 200 millisecond delay
noTone(buzzer); // no more tone on buzzer
delay(10); // 10 millisecond delay
}
colourRandom(); // random LED light
delay(500); // 500 millisecond delay
colourRandom(); // random LED light
rotateLeft (0, 180); // turn servo 180 degrees to left
colourRandom(); // random LED light
delay(500); // 500 millisecond delay
colourRandom(); // random LED light
rotateRight (180, 0); // turn servo 180 degrees to right
colourRandom(); // random LED light
delay(500); // 500 millisecond delay
colourRandom(); // random LED light
delay (1000); // 1000 millisecond delay
colourOff(); // switch off LED light
}
void encRight(){ // processing encoder interrupt 0 (right)
if (rotating) delay (1); // wait a millisecond for the turn to end
if (digitalRead(encDT) != right_set) { // if physical encoder value is not equal to the variable of the encoder right turn procedure
right_set = !right_set; // change value of encoder right turn procedure variable to the opposite value
if (right_set && !left_set) // if turning to the right occurs and not turning to the left (to adjust)
encPos += 1; // increase encoder position counter by 1
rotating = false; // no more debouncing until loop() hits again
}
}
void encLeft(){ // processing encoder interrupt 1 (left)
if (rotating) delay (1); // wait a millisecond for the turn to end
if (digitalRead(encCLK) != left_set) { // if physical encoder value is not equal to the variable of the encoder left turn procedure
left_set = !left_set; // change value of encoder left turn procedure variable to the opposite value
if (left_set && !right_set) // if turning to the left occurs and not turning to the right (to adjust)
encPos -= 1; // decrease encoder position counter by 1
rotating = false; // no more debouncing until loop() hits again
}
}
void randomNote() { // random note play function
delay(200); // 200 millisecond delay
playednote = random(1,7); // generate random value from 1 to 7 for the variable storing the last note played
tone(buzzer, gamma[playednote]); // sending the appropriate tone to buzzer
delay(2000); // 2000 millisecond delay
noTone(buzzer); // no more tone on buzzer
delay(200); // 200 millisecond delay
}

BIN
toneroulette_agg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
toneroulette_bb.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB