Go to advanced search

by rahulnpr18
Thu May 16, 2019 5:53 pm
Forum: Python
Topic: How to run a servo motor if a particular condition is satisfied
Replies: 15
Views: 852

Re: How to run a servo motor if a particular condition is satisfied

The print statement inside if condition instead of servo code runs infinitely , maybe that's why the motor troubles isn't? then how can i rewrite to print only once .? Untitled.jpg This is the code that i have tried . s_class = classes[scores > 0.5] if(s_class)==2: print("E WASTE Detected")
by rahulnpr18
Tue May 14, 2019 6:14 pm
Forum: Python
Topic: How to run a servo motor if a particular condition is satisfied
Replies: 15
Views: 852

Re: How to run a servo motor if a particular condition is satisfied

Okay thank you, but servo code alone works perfectly does that mean there is something hapenning wrong when the servo code inside the for loop?
by rahulnpr18
Mon May 13, 2019 2:02 am
Forum: Python
Topic: How to run a servo motor if a particular condition is satisfied
Replies: 15
Views: 852

Re: How to run a servo motor if a particular condition is satisfied

never mind the indentation cuz i pasted it wrongly , indented perfectly in my pi
by rahulnpr18
Mon May 13, 2019 12:59 am
Forum: Python
Topic: How to run a servo motor if a particular condition is satisfied
Replies: 15
Views: 852

Re: How to run a servo motor if a particular condition is satisfied

yes i ran your code it worked but when i ran it on my object detection script it shown the previous error
link to object detection script https://github.com/aswinr22/waste-model ... camera2.py (line 140-165)
by rahulnpr18
Sun May 12, 2019 8:30 pm
Forum: Python
Topic: How to run a servo motor if a particular condition is satisfied
Replies: 15
Views: 852

Re: How to run a servo motor if a particular condition is satisfied

No way its still p = GPIO.PWM(servoPIN, 50)
RuntimeError: A PWM object already exists for this GPIO channel
by rahulnpr18
Sun May 12, 2019 8:08 pm
Forum: Python
Topic: How to run a servo motor if a particular condition is satisfied
Replies: 15
Views: 852

Re: How to run a servo motor if a particular condition is satisfied

This is what i done , when i hit run it still running didn't produced the output servoPIN = 17 GPIO.setmode(GPIO.BCM) GPIO.setup(servoPIN, GPIO.OUT) p = GPIO.PWM(servoPIN, 50) for i in range (classes.size): if(classes[0][i] == 2 and scores[0][i]>0.5): def move_servo(): p.start(2.5) # Initialization ...
by rahulnpr18
Sun May 12, 2019 7:16 pm
Forum: Python
Topic: How to run a servo motor if a particular condition is satisfied
Replies: 15
Views: 852

Re: How to run a servo motor if a particular condition is satisfied

yes i given the function inside for loop and all pin setups outside the loop but its gives me a run time error "Runtime error A PWM object already exists for this GPIO channel"
by rahulnpr18
Sun May 12, 2019 6:13 pm
Forum: Python
Topic: How to run a servo motor if a particular condition is satisfied
Replies: 15
Views: 852

How to run a servo motor if a particular condition is satisfied

I have a script of python which is about object detection once a particular class is identified the servo motor should work Iam using object detection using tensorflow and opencv , basically scripts works by opening the picamera and detecting objects code for python script and servo give below :(lin...

Go to advanced search