diff --git a/code/test/sensor_tcst2103.py b/code/test/sensor_tcst2103.py new file mode 100644 index 0000000..8ad9bd6 --- /dev/null +++ b/code/test/sensor_tcst2103.py @@ -0,0 +1,41 @@ +import RPi.GPIO as GPIO +import time + +# photo sensor on PIN 5 +PIN_SENSOR = 5 + +# LED on PIN 22 +PIN_LED = 22 + +GPIO.setmode(GPIO.BCM) +GPIO.setup(PIN_SENSOR, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) +GPIO.setup(PIN_LED, GPIO.OUT) +GPIO.output(PIN_LED, GPIO.LOW) + + + +try: + while True: + print('Wait for photo sensor') + GPIO.wait_for_edge(PIN_SENSOR, GPIO.RISING) + + print('Photo sensor active, activating light') + + # turn LED on + GPIO.output(PIN_LED, GPIO.HIGH) + time.sleep(1) + GPIO.output(PIN_LED, GPIO.LOW) + + # wait until sensor is not blocked anymore (v1) + while (GPIO.input(PIN_SENSOR) == GPIO.HIGH): + print('blocked') + time.sleep(1) + + +# Exit when Ctrl-C is pressed +except KeyboardInterrupt: + print('Shutdown') + +finally: + print('Reset GPIO configuration and close') + GPIO.cleanup() diff --git a/misc/JBL_screws_drilling_template.pdf b/misc/JBL_screws_drilling_template.pdf new file mode 100644 index 0000000..80e32cf Binary files /dev/null and b/misc/JBL_screws_drilling_template.pdf differ diff --git a/misc/JBL_screws_drilling_template.svg b/misc/JBL_screws_drilling_template.svg index c8d6c1c..3f81073 100644 --- a/misc/JBL_screws_drilling_template.svg +++ b/misc/JBL_screws_drilling_template.svg @@ -1,6 +1,4 @@ - - + id="svg2" + viewBox="0 0 744.09448819 1052.3622047" + height="297mm" + width="210mm"> + id="DotL" + refX="0" + refY="0" + orient="auto" + inkscape:stockid="DotL"> + d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z" + id="path910" + inkscape:connector-curvature="0" /> + id="marker1201" + refX="0" + refY="0" + orient="auto" + inkscape:stockid="DotL"> + d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z" + id="path1199" + inkscape:connector-curvature="0" /> + inkscape:window-x="72" + inkscape:window-height="1016" + inkscape:window-width="1848" + showgrid="false" + inkscape:current-layer="layer1" + inkscape:document-units="px" + inkscape:cy="276.77241" + inkscape:cx="474.33543" + inkscape:zoom="3.959798" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base" /> @@ -80,341 +79,334 @@ + inkscape:label="Ebene 1"> - - + + - + cx="357.87402" + id="circle4165" + style="fill:none;fill-opacity:0.83265303;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + d="m 340.15748,164.76339 35.43307,0" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + - + d="m 464.17362,340.15748 0,-19.8642" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> 30 - 30 5,61 + id="tspan4159" + x="291.17648" + y="352.32651" + style="font-size:12.5px;line-height:1.25">30 35 - 45 - 45 + y="336.4166" + x="468.20572" + id="tspan4163" + sodipodi:role="line">5,61 35 + 14,5 + x="346.73486" + id="tspan4179" + sodipodi:role="line">14,5 - + d="m 258.59905,312.93054 93.94419,-90.66119" + style="fill:#808080;fill-rule:evenodd;stroke:#b3b3b3;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + style="fill:none;fill-opacity:0.83265303;stroke:#000000;stroke-width:1.00031245;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="circle844" + cx="357.85098" + cy="339.90768" /> - - + transform="translate(-2.6785711,68.87053)" + id="g855"> + + + d="m 563.83928,445.9621 h 7.08661" + style="fill:none;stroke:#000000;stroke-width:0.9375px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + transform="matrix(0,1,-0.969697,0,620.6749,-443.0999)"> + d="M 567.38257,95.643459 V 446.43085" + style="fill:none;stroke:#000000;stroke-width:0.95203573px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + - + inkscape:connector-curvature="0" /> 96 + x="349.83401" + id="tspan865" + sodipodi:role="line">96 99 + x="571.9502" + y="344.45786" + style="font-size:12.5px;line-height:1.25">99 + height="35.433071" + width="35.433071" + id="rect860" + style="opacity:1;fill:#333333;fill-opacity:1;stroke:none;stroke-width:0.99921274;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> 10 x 10 mm - - - - - Cutting template for the window glass - - - - - - - - - - - 50 + style="stroke-width:0.9375" + y="205.59882" + x="93.527916" + id="tspan862" + sodipodi:role="line">10 x 10 mm + + + + 28 - Cutting template for the window glass + + + + + + + + + + + 50 + 28 + Drilling template for the JBL On Stage IIIp speaker + x="84.834572" + y="66.899963" + style="stroke-width:0.9375">Drilling template for the JBL On Stage IIIp speaker + + + + + +