Skip to main content

front_left_detect()

Description#

Returns True if the front left IR sensor detects a value below a threshold. The value decreases as the light reflected back to the receiver increases.

Syntax#

front_left_detect()
front_left_detect(threshold=100)

Parameters#

threshold: Integer between 0-255

Returns#

Boolean that returns True if sensor is triggered.

Example Code#
Python#
#Python code
from zumi.zumi import Zumi
import time
zumi = Zumi()
for i in range(0,100):
if zumi.front_left_detect():
print("Detected!)
time.sleep(0.1) # Delay for I2C