From: Antonio Ospite <ao2@ao2.it> Date: Wed, 30 May 2018 14:24:43 +0000 (+0200) Subject: Initial import X-Git-Url: https://git.ao2.it/experiments/Hall_effect_rotary_encoder.git/commitdiff_plain/HEAD Initial import --- 459a44ca0247324d50b5ca9298c611627d2303c7 diff --git a/Fritzing/Hall-Effect-Sensor.fzz b/Fritzing/Hall-Effect-Sensor.fzz new file mode 100644 index 0000000..57ba1d3 Binary files /dev/null and b/Fritzing/Hall-Effect-Sensor.fzz differ diff --git a/Fritzing/parts/US1881UA_3394d811b1e61364d06f034ffbe599db_6.fzp b/Fritzing/parts/US1881UA_3394d811b1e61364d06f034ffbe599db_6.fzp new file mode 100644 index 0000000..b68a8f3 --- /dev/null +++ b/Fritzing/parts/US1881UA_3394d811b1e61364d06f034ffbe599db_6.fzp @@ -0,0 +1,101 @@ +<?xml version='1.0' encoding='UTF-8'?> +<module moduleId="US1881UA_3394d811b1e61364d06f034ffbe599db_6" referenceFile="mystery_part_sip_3_100mil.fzp"> + <version>4</version> + <author>Antonio Ospite</author> + <title>US1881 Hall effect sensor</title> + <label>U</label> + <date>mar mag 29 2018</date> + <tags> + <tag>sensor</tag> + </tags> + <properties> + <property name="variant">Variant 1</property> + <property name="family">Sensor</property> + <property name="chip label">US1881</property> + <property name="part number"></property> + <property name="pin spacing">100mil</property> + <property name="hole size"></property> + <property name="editable pin labels">false</property> + <property name="package">THT</property> + <property name="layer"></property> + <property name="pins">3</property> + <property name="layout">Single Row</property> + </properties> + <taxonomy>part.mystery.magical.3.pins</taxonomy> + <description><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></description> + <views> + <iconView> + <layers image="icon/US1881UA_2d0ad8960d79f0a6ab217e6b43398fc3_2_icon.svg"> + <layer layerId="icon"/> + </layers> + </iconView> + <breadboardView> + <layers image="breadboard/US1881UA_2d0ad8960d79f0a6ab217e6b43398fc3_2_breadboard.svg"> + <layer layerId="breadboard"/> + </layers> + </breadboardView> + <schematicView> + <layers image="schematic/US1881UA_2d0ad8960d79f0a6ab217e6b43398fc3_2_schematic.svg"> + <layer layerId="schematic"/> + </layers> + </schematicView> + <pcbView> + <layers image="pcb/US1881UA_2d0ad8960d79f0a6ab217e6b43398fc3_2_pcb.svg"> + <layer layerId="silkscreen"/> + <layer layerId="copper0"/> + <layer layerId="copper1"/> + </layers> + </pcbView> + </views> + <connectors> + <connector id="connector0" type="male" name="VDD"> + <description>Supply Voltage pin</description> + <views> + <breadboardView> + <p svgId="connector0pin" terminalId="connector0terminal" layer="breadboard"/> + </breadboardView> + <schematicView> + <p svgId="connector0pin" terminalId="connector0terminal" layer="schematic"/> + </schematicView> + <pcbView> + <p svgId="connector0pin" layer="copper0"/> + <p svgId="connector0pin" layer="copper1"/> + </pcbView> + </views> + </connector> + <connector id="connector1" type="male" name="GND"> + <description>Ground pin</description> + <views> + <breadboardView> + <p svgId="connector1pin" terminalId="connector1terminal" layer="breadboard"/> + </breadboardView> + <schematicView> + <p svgId="connector1pin" terminalId="connector1terminal" layer="schematic"/> + </schematicView> + <pcbView> + <p svgId="connector1pin" layer="copper0"/> + <p svgId="connector1pin" layer="copper1"/> + </pcbView> + </views> + </connector> + <connector id="connector2" type="male" name="OUT"> + <description>Output pin</description> + <views> + <breadboardView> + <p svgId="connector2pin" terminalId="connector2terminal" layer="breadboard"/> + </breadboardView> + <schematicView> + <p svgId="connector2pin" terminalId="connector2terminal" layer="schematic"/> + </schematicView> + <pcbView> + <p svgId="connector2pin" layer="copper0"/> + <p svgId="connector2pin" layer="copper1"/> + </pcbView> + </views> + </connector> + </connectors> +</module> diff --git a/Fritzing/svg/US1881_PCB.svg b/Fritzing/svg/US1881_PCB.svg new file mode 100644 index 0000000..c293c75 --- /dev/null +++ b/Fritzing/svg/US1881_PCB.svg @@ -0,0 +1,189 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Fritzing (http://www.fritzing.org/) --> + +<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" + version="1.2" + x="0in" + y="0in" + width="4.0999999mm" + height="1.4548388mm" + viewBox="0 0 11.622047 4.1239525" + id="svg35" + sodipodi:docname="US1881_PCB.svg" + inkscape:version="0.92.3 (2405546, 2018-03-11)"> + <metadata + id="metadata41"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs39" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1280" + inkscape:window-height="911" + id="namedview37" + showgrid="false" + inkscape:document-units="mm" + units="mm" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:zoom="57.843137" + inkscape:cx="5.4458838" + inkscape:cy="1.7908493" + inkscape:window-x="0" + inkscape:window-y="28" + inkscape:window-maximized="1" + inkscape:current-layer="svg35" + inkscape:measure-start="-0.0518644,7.33017" + inkscape:measure-end="4.70237,2.69695" /> + <g + id="g868" + transform="matrix(0,0.52070103,-0.52070103,0,12.184405,-0.56235713)"> + <g + id="g7" + partID="854153460"> + <g + id="copper0" + gorn="0.2.0"> + <rect + width="4.1760001" + y="2.9519999" + x="2.9519999" + height="4.1760001" + id="square" + gorn="0.2.0.0" + style="fill:none;stroke:#ffbf00;stroke-width:1.44000006" /> + <circle + cy="5.04" + cx="5.04" + id="connector0pin" + gorn="0.2.0.1" + r="2.0880001" + style="fill:none;stroke:#ffbf00;stroke-width:1.44000006" /> + <circle + cy="12.24" + cx="5.04" + id="connector1pin" + gorn="0.2.0.2" + r="2.0880001" + style="fill:none;stroke:#ffbf00;stroke-width:1.44000006" /> + <circle + cy="19.440001" + cx="5.04" + id="connector2pin" + gorn="0.2.0.3" + r="2.0880001" + style="fill:none;stroke:#ffbf00;stroke-width:1.44000006" /> + </g> + </g> + <g + id="g20" + partID="854153461"> + <g + id="copper1" + gorn="0.2"> + <g + id="g17" + gorn="0.2.0"> + <rect + width="4.1760001" + y="2.9519999" + x="2.9519999" + height="4.1760001" + id="rect9" + gorn="0.2.0.0" + style="fill:none;stroke:#ffbf00;stroke-width:1.44000006" /> + <circle + cy="5.04" + cx="5.04" + id="circle11" + gorn="0.2.0.1" + r="2.0880001" + style="fill:none;stroke:#ffbf00;stroke-width:1.44000006" /> + <circle + cy="12.24" + cx="5.04" + id="circle13" + gorn="0.2.0.2" + r="2.0880001" + style="fill:none;stroke:#ffbf00;stroke-width:1.44000006" /> + <circle + cy="19.440001" + cx="5.04" + id="circle15" + gorn="0.2.0.3" + r="2.0880001" + style="fill:none;stroke:#ffbf00;stroke-width:1.44000006" /> + </g> + </g> + </g> + <g + id="g33" + partID="854153462"> + <g + id="silkscreen" + gorn="0.1"> + <line + id="line22" + x2="1.4400001" + x1="1.4400001" + y2="23.040001" + y1="1.4400001" + style="stroke:#ffffff;stroke-width:0.72000003" /> + <line + id="line24" + x2="8.6400003" + x1="1.4400001" + y2="23.040001" + y1="23.040001" + style="stroke:#ffffff;stroke-width:0.72000003" /> + <line + id="line26" + x2="8.6400003" + x1="8.6400003" + y2="1.4400001" + y1="23.040001" + style="stroke:#ffffff;stroke-width:0.72000003" /> + <line + id="line28" + x2="1.4400001" + x1="8.6400003" + y2="1.4400001" + y1="1.4400001" + style="stroke:#ffffff;stroke-width:0.72000003" /> + <line + id="line30" + x2="3.96" + x1="1.4400001" + y2="1.4400001" + y1="3.96" + style="stroke:#ffffff;stroke-width:0.36000001" /> + <!-- 120 --> + </g> + </g> + </g> +</svg> diff --git a/Fritzing/svg/US1881_breadboard.svg b/Fritzing/svg/US1881_breadboard.svg new file mode 100644 index 0000000..6b4c82c --- /dev/null +++ b/Fritzing/svg/US1881_breadboard.svg @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Fritzing (http://www.fritzing.org/) --> + +<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" + height="1.5mm" + viewBox="0 0 161.41732 59.055114" + x="0in" + y="0in" + version="1.2" + width="4.0999999mm" + id="svg18" + sodipodi:docname="US1881_breadboard.svg" + inkscape:version="0.92.3 (2405546, 2018-03-11)"> + <metadata + id="metadata24"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs22" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1280" + inkscape:window-height="911" + id="namedview20" + showgrid="false" + inkscape:document-units="mm" + units="mm" + inkscape:zoom="22.627417" + inkscape:cx="6.3086667" + inkscape:cy="0.78553392" + inkscape:window-x="0" + inkscape:window-y="28" + inkscape:window-maximized="1" + inkscape:current-layer="svg18" + showguides="true" + inkscape:guide-bbox="true" + inkscape:measure-start="11.4905,5.61266" + inkscape:measure-end="10.3856,9.23658" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0"> + <sodipodi:guide + position="5e-06,29.527545" + orientation="0.99862953,0.052335956" + id="guide861" + inkscape:locked="false" + inkscape:label="" + inkscape:color="rgb(0,0,255)" /> + </sodipodi:namedview> + <desc + id="desc2"> + <referenceFile>mystery_part_3_sip_100mil_bread.svg</referenceFile> + </desc> + <g + id="g827" + transform="translate(-19.836863,-77.011161)"> + <g + transform="translate(0,66.94941)" + id="g858"> + <path + sodipodi:nodetypes="ccccc" + inkscape:connector-curvature="0" + id="upper" + d="M 49.309815,10.061751 H 151.68209 l 29.57209,29.527558 H 19.836863 Z" + style="fill:#000000;stroke-width:0" /> + <path + sodipodi:nodetypes="ccccc" + inkscape:connector-curvature="0" + id="upper-8" + d="M 19.836868,39.58931 H 181.25418 l -1.54622,29.527557 H 21.448114 Z" + style="fill:#000000;stroke-width:0" /> + </g> + <g + transform="translate(43.065209,-64.131415)" + id="g889"> + <rect + style="fill:#8c8c8c;stroke:none;stroke-width:0" + width="14.960629" + y="170.67014" + id="connector0terminal" + x="0" + height="14.960629" /> + <rect + style="fill:#8c8c8c;stroke:none;stroke-width:0" + width="14.960629" + y="170.67014" + id="connector0terminal-3" + x="50" + height="14.960629" /> + <rect + style="fill:#8c8c8c;stroke:none;stroke-width:0" + width="14.960629" + y="170.67014" + id="connector0terminal-0" + x="100" + height="14.960629" /> + </g> + </g> +</svg> diff --git a/Fritzing/svg/US1881_schematic.svg b/Fritzing/svg/US1881_schematic.svg new file mode 100644 index 0000000..74ed33e --- /dev/null +++ b/Fritzing/svg/US1881_schematic.svg @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Fritzing (http://www.fritzing.org/) --> + +<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" + version="1.2" + x="0in" + y="0in" + width="0.69846851in" + height="0.7853024in" + viewBox="0 0 50.289733 56.541772" + id="svg35" + sodipodi:docname="Untitled Sketch 3_schem.svg" + inkscape:version="0.92.3 (2405546, 2018-03-11)"> + <metadata + id="metadata41"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs39" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1280" + inkscape:window-height="911" + id="namedview37" + showgrid="false" + showguides="false" + inkscape:zoom="6.1458332" + inkscape:cx="39.298787" + inkscape:cy="27.094184" + inkscape:window-x="0" + inkscape:window-y="28" + inkscape:window-maximized="1" + inkscape:current-layer="svg35" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" /> + <rect + id="connector0pin" + x="-13.95" + height="0.69999802" + y="20.747057" + width="14.4" + connectorName="1" + style="fill:none;stroke-width:0" /> + <rect + id="connector1pin" + x="-13.95" + height="0.69999802" + y="27.947058" + width="14.4" + connectorName="2" + style="fill:none;stroke-width:0" /> + <rect + id="connector2pin" + x="-13.95" + height="0.69999802" + y="35.147057" + width="14.4" + connectorName="3" + style="fill:none;stroke-width:0" /> + <g + id="g904" + transform="translate(-13.95,13.897057)"> + <rect + style="fill:none;stroke:#000000;stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:round" + id="rect2" + width="35.549999" + y="0.44999999" + height="27.9" + x="14.4" /> + <text + style="font-size:3.5px;font-family:'Droid Sans';text-anchor:start;fill:#8c8c8c;stroke:none" + y="4.7270985" + x="21.174217" + id="label0" + font-size="3.5">VDD</text> + <line + style="fill:none;stroke:#787878;stroke-width:0.69999802;stroke-linecap:round;stroke-linejoin:round" + id="line12" + x2="63.884747" + x1="49.834743" + y2="14.4" + y1="14.4" /> + <text + style="font-size:3.5px;font-family:'Droid Sans';text-anchor:start;fill:#8c8c8c;stroke:none" + y="26.540062" + x="21.64077" + id="label1" + font-size="3.5">VSS</text> + <line + style="fill:none;stroke:#787878;stroke-width:0.69999802;stroke-linecap:round;stroke-linejoin:round" + id="line5" + x2="24.974998" + x1="24.974998" + y2="42.28973" + y1="28.239729" /> + <line + style="fill:none;stroke:#787878;stroke-width:0.69999802;stroke-linecap:round;stroke-linejoin:round" + id="line19" + x2="24.974998" + x1="24.974998" + y2="0.50792629" + y1="-13.542073" /> + <text + style="font-size:3.5px;font-family:'Droid Sans';text-anchor:start;fill:#8c8c8c;stroke:none" + y="15.674047" + x="41.380207" + id="label2" + font-size="3.5">OUT</text> + </g> +</svg> diff --git a/Tetramag-ring-magnet.svg b/Tetramag-ring-magnet.svg new file mode 100644 index 0000000..2006099 --- /dev/null +++ b/Tetramag-ring-magnet.svg @@ -0,0 +1,751 @@ +<?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:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + height="55.133369mm" + version="1.1" + viewBox="0 0 55.1334 55.1334" + width="55.133369mm" + id="svg51" + sodipodi:docname="Tetramag-ring-magnet.svg" + inkscape:version="0.92.3 (2405546, 2018-03-11)" + inkscape:export-filename="/home/ao2/sketchbook/Hall_effect_rotary_encoder/Tetramag-ring-magnet.svg.png" + inkscape:export-xdpi="598.91138" + inkscape:export-ydpi="598.91138"> + <metadata + id="metadata55"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1280" + inkscape:window-height="911" + id="namedview53" + showgrid="false" + inkscape:zoom="2" + inkscape:cx="125.89222" + inkscape:cy="137.86384" + inkscape:window-x="0" + inkscape:window-y="28" + inkscape:window-maximized="1" + inkscape:current-layer="svg51" + showguides="true" + inkscape:guide-bbox="true" + inkscape:measure-start="95.4844,12.8125" + inkscape:measure-end="96.3906,12.8125" /> + <defs + id="defs2"> + <marker + inkscape:isstock="true" + style="overflow:visible" + id="marker97354" + refX="0" + refY="0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="matrix(-0.4,0,0,-0.4,-4,0)" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + id="path97352" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible" + id="marker97308" + refX="0" + refY="0" + orient="auto" + inkscape:stockid="Arrow1Mstart"> + <path + transform="matrix(0.4,0,0,0.4,4,0)" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + id="path97306" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0" + refX="0" + id="marker79531" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path79529" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="matrix(-0.4,0,0,-0.4,-4,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0" + refX="0" + id="marker79485" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path79483" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="matrix(0.4,0,0,0.4,4,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0" + refX="0" + id="marker78315" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path78313" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="matrix(-0.4,0,0,-0.4,-4,0)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0" + refX="0" + id="marker78269" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path78267" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="matrix(0.4,0,0,0.4,4,0)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="Arrow2Lend" + orient="auto" + refY="0" + refX="0" + id="marker3151" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path3149" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" + d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" + transform="matrix(-1.1,0,0,-1.1,-1.1,0)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="marker3081" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path3079" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="Arrow2Mend" + orient="auto" + refY="0" + refX="0" + id="Arrow2Mend" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path2494" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" + d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" + transform="scale(-0.6)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path2609" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="Arrow2Lend" + orient="auto" + refY="0" + refX="0" + id="Arrow2Lend" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path2488" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" + d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" + transform="matrix(-1.1,0,0,-1.1,-1.1,0)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0" + refX="0" + id="Arrow1Lend" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path2470" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="matrix(-0.8,0,0,-0.8,-10,0)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="Arrow1Lstart" + orient="auto" + refY="0" + refX="0" + id="Arrow1Lstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path2467" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="matrix(0.8,0,0,0.8,10,0)" + inkscape:connector-curvature="0" /> + </marker> + <linearGradient + inkscape:collect="always" + id="linearGradient839"> + <stop + style="stop-color:#0000ff;stop-opacity:1" + offset="0" + id="stop835" /> + <stop + style="stop-color:#ff0000;stop-opacity:1" + offset="1" + id="stop837" /> + </linearGradient> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0" + refX="0" + id="Arrow1Mstart-5-7" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path2473-3-9" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="matrix(0.4,0,0,0.4,4,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0" + refX="0" + id="Arrow1Mend-5-2" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path2476-6-0" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="matrix(-0.4,0,0,-0.4,-4,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0" + refX="0" + id="Arrow1Mstart-2" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path2473-8" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="matrix(0.4,0,0,0.4,4,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0" + refX="0" + id="Arrow1Mend-9" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path2476-7" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="matrix(-0.4,0,0,-0.4,-4,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient839" + id="linearGradient1019" + gradientUnits="userSpaceOnUse" + x1="27.567326" + y1="42.938477" + x2="27.572493" + y2="42.938477" /> + </defs> + <g + id="g1194"> + <rect + y="-9.6715235e-07" + x="-9.6715235e-07" + height="55.133404" + width="55.133404" + id="rect1123" + style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.99215686;stroke:none;stroke-width:1.08300066;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:6.49800384, 6.49800384;stroke-dashoffset:0;stroke-opacity:1" /> + <g + id="id1"> + <g + id="g1317"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.01304128;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker79485);marker-end:url(#marker79531)" + d="m 27.605614,48.584961 h 1.198764" + id="path2465-2" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:0.35277799px;line-height:1em;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0.01852085px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.2645835px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="27.547857" + y="49.033512" + id="text3839-9"><tspan + sodipodi:role="line" + id="tspan3837-1" + x="27.547857" + y="49.033512" + style="font-size:0.35277799px;stroke-width:0.2645835px">1.25mm</tspan></text> + <path + inkscape:connector-curvature="0" + id="path2444-7-2" + d="m 27.566685,47.646599 v 1.041144" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.02645835;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.07937505, 0.07937505;stroke-dashoffset:0;stroke-opacity:1" + sodipodi:nodetypes="cc" /> + <path + inkscape:connector-curvature="0" + id="path2444-7-2-7" + d="m 28.843307,47.28073 v 1.392544" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.02645835;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.07937505, 0.07937505;stroke-dashoffset:0;stroke-opacity:1" + sodipodi:nodetypes="cc" /> + </g> + <g + id="g1298"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.01500001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 25.066685,44.939986 c 0,3.25067 0,3.554687 0,3.554687" + id="path2444" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.01500001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 30.066685,45.010145 c 0,3.25067 0,3.554687 0,3.554687" + id="path2444-7" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.02635633;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker78269);marker-end:url(#marker78315)" + d="M 25.118559,48.10588 H 30.01481" + id="path2465" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:0.35277799px;line-height:1em;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0.01852085px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.2645835px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="26.373671" + y="48.047421" + id="text3839"><tspan + sodipodi:role="line" + id="tspan3837" + x="26.373671" + y="48.047421" + style="font-size:0.35277799px;stroke-width:0.2645835px">5mm</tspan></text> + </g> + <circle + style="fill:url(#linearGradient1019);fill-opacity:1;stroke:#000000;stroke-width:0.02645835;stroke-miterlimit:4;stroke-dasharray:none" + id="circle6" + r="2.5" + cy="45.133369" + cx="27.566685" /> + <g + transform="translate(0.07957576,0.09095941)" + id="g1553"> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:1.05833399px;line-height:1em;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0.01852085px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.2645835px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="26.133963" + y="45.428173" + id="text1529"><tspan + sodipodi:role="line" + id="tspan1527" + x="26.133963" + y="45.428173" + style="font-size:1.05833399px;fill:#ffffff;stroke-width:0.2645835px">N</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:1.05833399px;line-height:1em;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0.01852085px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.2645835px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="28.123503" + y="45.427658" + id="text1529-3"><tspan + sodipodi:role="line" + id="tspan1527-6" + x="28.123503" + y="45.427658" + style="font-size:1.05833399px;fill:#ffffff;stroke-width:0.2645835px">S</tspan></text> + </g> + </g> + <circle + style="fill:none;stroke:#000000;stroke-width:0.02645835;stroke-miterlimit:4;stroke-dasharray:none" + id="circle4" + r="15.066686" + cy="27.566685" + cx="27.566685" /> + <use + height="100%" + width="100%" + id="use9" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(16.363636,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use11" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(32.727273,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use13" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(49.090909,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use15" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(65.454545,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use17" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(81.818182,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use19" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(98.181818,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use21" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(114.54545,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use23" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(130.90909,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use25" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(147.27273,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use27" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(163.63636,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use29" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(180,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use31" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(-163.63636,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use33" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(-147.27273,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use35" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(-130.90909,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use37" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(-114.54546,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use39" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(-98.181818,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use41" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(-81.818182,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use43" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(-65.454545,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use45" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(-49.090909,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use47" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(-32.727273,27.566685,27.566685)" /> + <use + height="100%" + width="100%" + id="use49" + y="0" + xlink:href="#id1" + x="0" + transform="rotate(-16.363636,27.566685,27.566685)" /> + <g + transform="translate(0.0382219)" + id="g4645"> + <g + transform="matrix(0.06819926,0,0,-0.06819926,18.681746,101.75337)" + id="g3757"> + <g + transform="translate(-0.3016764,425.45979)" + id="g2568"> + <g + transform="matrix(3.84,0,0,-14.04,90.47952,304.1604)" + id="g554" /> + <g + transform="matrix(19.2,0,0,-15.12,94.19952,304.4004)" + id="g562" /> + <g + transform="matrix(26.88,0,0,-15.12,96.71952,361.1604)" + id="g570" /> + <path + inkscape:connector-curvature="0" + id="path934" + style="fill:none;stroke:#010101;stroke-width:0.470808;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + d="M 100.19952,330.5604 H 159.84" /> + <path + sodipodi:nodetypes="ccccccc" + inkscape:connector-curvature="0" + d="m 149.52,340.8804 10.32,-10.32 -0.84,-11.4 h -58.08048 l -0.72,11.4 10.08,10.32 z" + style="fill:none;stroke:#010101;stroke-width:0.470808;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path946" /> + <path + inkscape:connector-curvature="0" + id="path948" + style="fill:none;stroke:#010101;stroke-width:0.470808;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + d="m 126.6,330.5604 v -3.72" /> + <path + inkscape:connector-curvature="0" + id="path950" + style="fill:none;stroke:#010101;stroke-width:0.470808;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + d="m 126.6,326.8404 h 6.6" /> + <path + inkscape:connector-curvature="0" + id="path952" + style="fill:none;stroke:#010101;stroke-width:0.470808;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + d="m 133.2,326.8404 v 3.72" /> + <path + inkscape:connector-curvature="0" + id="path954" + style="fill:none;stroke:#010101;stroke-width:0.470808;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + d="m 144.96,330.5604 v -3.72" /> + <path + inkscape:connector-curvature="0" + id="path956" + style="fill:none;stroke:#010101;stroke-width:0.470808;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + d="m 144.96,326.8404 h 6.72" /> + <path + inkscape:connector-curvature="0" + id="path958" + style="fill:none;stroke:#010101;stroke-width:0.470808;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + d="m 151.68,326.8404 v 3.72" /> + <path + inkscape:connector-curvature="0" + id="path1028" + style="fill:none;stroke:#010101;stroke-width:0.470808;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + d="m 107.51952,330.5604 v -3.72" /> + <path + inkscape:connector-curvature="0" + id="path1030" + style="fill:none;stroke:#010101;stroke-width:0.470808;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + d="m 107.51952,326.8404 h 6.72" /> + <path + inkscape:connector-curvature="0" + id="path1032" + style="fill:none;stroke:#010101;stroke-width:0.470808;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + d="m 114.23952,326.8404 v 3.72" /> + </g> + <path + id="path802-5-2" + d="m 134.23919,756.40352 v 1.97317 h -9.04222 v -1.97317 z" + style="fill:#e0c1ff;fill-opacity:1;stroke:#001c01;stroke-width:0.29579556;stroke-opacity:1" + inkscape:connector-curvature="0" /> + </g> + <g + id="g4615"> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.01500001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 25.485733,50.192834 9e-5,1.670579" + id="path2444-78" + inkscape:connector-curvature="0" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.01500001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 29.571193,50.192834 v 1.670579" + id="path2444-7-4" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.02386637;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker97308);marker-end:url(#marker97354)" + d="m 25.542716,51.438761 h 3.973867" + id="path2465-5" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:0.35277799px;line-height:1em;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0.01852085px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.2645835px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="26.873245" + y="51.803368" + id="text3839-0"><tspan + sodipodi:role="line" + id="tspan3837-3" + x="26.873245" + y="51.803368" + style="font-size:0.35277799px;stroke-width:0.2645835px">4.1mm</tspan></text> + </g> + </g> + <use + transform="translate(-4.3291777)" + height="100%" + width="100%" + id="use4647" + xlink:href="#g4645" + y="0" + x="0" /> + <path + inkscape:connector-curvature="0" + id="path2444-7-2-7-4-3" + d="m 27.566685,47.646599 v 5.374104" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.02645835;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.07937505, 0.07937505;stroke-dashoffset:0;stroke-opacity:1" + sodipodi:nodetypes="cc" /> + <path + inkscape:connector-curvature="0" + id="path2444-7-2-7-4" + d="m 23.237507,46.841839 v 6.178864" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.02645835;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.07937505, 0.07937505;stroke-dashoffset:0;stroke-opacity:1" + sodipodi:nodetypes="cc" /> + </g> +</svg> diff --git a/rotary_encoder/Makefile b/rotary_encoder/Makefile new file mode 100644 index 0000000..cc24a34 --- /dev/null +++ b/rotary_encoder/Makefile @@ -0,0 +1,6 @@ +BOARD_TAG = uno +MONITOR_PORT = /dev/ttyACM0 + +ARDUINO_LIBS = DFRkeypad Encoder LiquidCrystal + +include /usr/share/arduino/Arduino.mk diff --git a/rotary_encoder/rotary_encoder.ino b/rotary_encoder/rotary_encoder.ino new file mode 100644 index 0000000..8515524 --- /dev/null +++ b/rotary_encoder/rotary_encoder.ino @@ -0,0 +1,75 @@ +/* + * Rotary encoder example + * + * Copyright (C) 2018 Antonio Ospite <ao2@ao2.it> + * SPDX-License-Identitier: WTFPL + */ + +#include <DFRkeypad.h> +#include <Encoder.h> +#include <LiquidCrystal.h> + +#define ENCODER_CHANNEL_A 2 +#define ENCODER_CHANNEL_B 3 + +#define COUNTS_PER_ROTATION 84 + +#define LCD_RS 8 +#define LCD_EN 9 +#define LCD_D4 4 +#define LCD_D5 5 +#define LCD_D6 6 +#define LCD_D7 7 +#define LCD_BL 10 + +#define BACKLIGHT_VALUE 1023 + +long old_counts = 0; +Encoder encoder(ENCODER_CHANNEL_A, ENCODER_CHANNEL_B); +LiquidCrystal lcd(LCD_RS, LCD_EN, LCD_D4, LCD_D5, LCD_D6, LCD_D7); + +void setup() { + pinMode(LCD_BL, OUTPUT); + analogWrite(LCD_BL, BACKLIGHT_VALUE); + + lcd.begin(16, 2); + + lcd.setCursor(1, 0); + lcd.print("Rotary Encoder"); + lcd.setCursor(1, 1); + lcd.print("https://ao2.it"); + + DFRkeypad::FastADC(true); + DFRkeypad::iDEFAULT_THRESHOLD=140; +} + +void loop() { + byte key = DFRkeypad::GetKey(); + if (key == DFRkeypad::eSELECT) { + encoder.write(0); + } + + long new_counts = encoder.read(); + if (new_counts != old_counts) { + old_counts = new_counts; + + lcd.clear(); + + lcd.setCursor(0, 0); + lcd.print("Count: "); + lcd.setCursor(8, 0); + lcd.print(new_counts); + + /* Position normalized between 0 and COUNTS_PER_ROTATION */ + long position = ((new_counts % COUNTS_PER_ROTATION) + COUNTS_PER_ROTATION) % COUNTS_PER_ROTATION; + + float angle = position * (360.0 / COUNTS_PER_ROTATION); + + lcd.setCursor(0, 1); + lcd.print("Angle: "); + lcd.setCursor(8, 1); + lcd.print(angle); + } + + delay(20); +} diff --git a/show_quadrature_states/Makefile b/show_quadrature_states/Makefile new file mode 100644 index 0000000..7b0316f --- /dev/null +++ b/show_quadrature_states/Makefile @@ -0,0 +1,6 @@ +BOARD_TAG = uno +MONITOR_PORT = /dev/ttyACM0 + +ARDUINO_LIBS = Encoder + +include /usr/share/arduino/Arduino.mk diff --git a/show_quadrature_states/show_quadrature_states.ino b/show_quadrature_states/show_quadrature_states.ino new file mode 100644 index 0000000..b44f0ad --- /dev/null +++ b/show_quadrature_states/show_quadrature_states.ino @@ -0,0 +1,44 @@ +/* + * Show quadrature states of two Hall effect sensors. + * + * Copyright (C) 2018 Antonio Ospite <ao2@ao2.it> + * SPDX-License-Identitier: WTFPL + */ + +#define HALL_CHANNEL_A 2 +#define HALL_CHANNEL_B 3 +#define LED_PIN 13 + +int hall_state_A = 0; +int hall_state_B = 0; + +int old_hall_state_A = -1; +int old_hall_state_B = -1; + +void setup() +{ + pinMode(HALL_CHANNEL_A, INPUT); + pinMode(HALL_CHANNEL_B, INPUT); + pinMode(LED_PIN, OUTPUT); + Serial.begin(115200); +} + +void loop() +{ + hall_state_A = digitalRead(HALL_CHANNEL_A); + hall_state_B = digitalRead(HALL_CHANNEL_B); + + if (hall_state_A != old_hall_state_A || + hall_state_B != old_hall_state_B) + { + digitalWrite(LED_PIN, hall_state_A); + + old_hall_state_A = hall_state_A; + old_hall_state_B = hall_state_B; + + Serial.print(hall_state_A); + Serial.print(" "); + Serial.print(hall_state_B); + Serial.print("\r\n"); + } +}