smile007
Posts: 7
Joined: Wed Apr 27, 2016 4:14 pm

regarding light sensor can't detect ANYTHING

Fri Apr 29, 2016 4:11 pm

there are my component.
2 DC motors
1 raspi robot
1 light senor
1 raspberry pi 2 model B

i sudo this code, then there is just 0

Image
Image
Image

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: regarding light sensor can't detect ANYTHING

Fri Apr 29, 2016 9:22 pm

Have you adjusted the potentiometer? Slowly turn it until the state of the output changes
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

tenochtitlanuk
Posts: 156
Joined: Fri Jul 06, 2012 8:51 pm
Location: Taunton, Somerset, UK
Contact: Website

Re: regarding light sensor can't detect ANYTHING

Sat Apr 30, 2016 9:38 am

Python goes round 0-->10 very fast. Better to use a delay or longer loop, or terminate on a key-press??

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: regarding light sensor can't detect ANYTHING

Wed May 04, 2016 1:21 pm

Just use an infinite while loop and use <CTRL>+C to exit.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

Return to “Automation, sensing and robotics”