Data Sheet

www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
Beispielcode fortgeführt.
Führen Sie den Beispielcode mit folgenden Befehlen im Terminal aus:
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--clear', action='store_true', help='clear the dis-
play on exit')
args = parser.parse_args()
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT,
LED_BRIGHTNESS, LED_CHANNEL)
strip.begin()
while True:
value = readadc(SENSOR)
print("Value: " + str(value))
time.sleep(0.5)
if int(value) < int(500):
print ("Licht an")
colorWipe(strip, Color(255, 0, 0), 50)
else:
print ("Licht aus")
colorWipe(strip, Color(0, 0, 0), 50)
cd /rpi_ws281x/python/examples
sudo python Lichtsensor.py