0% found this document useful (0 votes)
6 views2 pages

Proximity Sensor Motor Control Code

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Proximity Sensor Motor Control Code

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

from [Link].

apds import APDS


from [Link] import Motor
from time import sleep_ms

ADPS = None
Motor = None
Proximity_Value = None

ADPS = APDS(port=1,ob=True)
Motor = Motor(port=2,ob=True)
ADPS.enable_proximity()
while True:
sleep_ms(100)
Proximity_Value = ADPS.read_proximity()
print('Proximity Value')
if Proximity_Value > 50:
[Link](speed=100, direction=True)
else:
[Link](speed=0, direction=True)
sleep_ms(100)from [Link] import APDS

from [Link] import Motor

from time import sleep_ms

ADPS = None

Motor = None

Proximity_Value = None

ADPS = APDS(port=1,ob=True)

Motor = Motor(port=2,ob=True)

ADPS.enable_proximity()

while True:

sleep_ms(100)

Proximity_Value = ADPS.read_proximity()

print('Proximity Value')

if Proximity_Value > 50:

[Link](speed=100, direction=True)

else:

[Link](speed=0, direction=True)
sleep_ms(100)

You might also like