Stap 3: Infrarood Sensor
此處需要import mraa
程式碼如下
Detect = mraa. GPIO(7)
Detect.dir (mraa. DIR_IN)
terwijl juist:
mensen = detect.read()
if(People):
myLcd.setColor (255, 0, 0)
myLcd.setCursor(0,0)
myLcd.write ('mensen die...')
anders:
myLcd.setColor (255, 0, 0)
myLcd.setCursor(0,0)
myLcd.write (' niemand hier...')