Go to advanced search

by luiskrlos84
Sat May 06, 2017 8:50 pm
Forum: Python
Topic: Help with time cycle on photogate code
Replies: 1
Views: 319

Help with time cycle on photogate code

My project objective is to use a ramp that we will scan three different sizes(small, meduim, large) boxs. Measure the time delay from start and stop using our photogate circuit and depending on the size, it will activate the corresponding servo to guide the box in the correct direction terminal. The...
by luiskrlos84
Sat May 06, 2017 3:11 am
Forum: Beginners
Topic: Range command
Replies: 2
Views: 493

Range command

I need to use the range between 2 and 5 in a if statement, can someone tell me how to use it?

Code: Select all

if stop - start  > 2  < 5:
that is how I am using it but its not correct, thanks.
by luiskrlos84
Wed May 03, 2017 11:56 pm
Forum: Beginners
Topic: Photogate
Replies: 0
Views: 352

Photogate

18191662_10212128135615195_1569448661_n.jpg I have a photogate code that its already working, it measures how long the signal gets cut, this is the code: import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(11,GPIO.IN) start = time.time() stop = time.time() gateState = False mid ...
by luiskrlos84
Wed Apr 05, 2017 12:32 am
Forum: Beginners
Topic: Can anybody help with this Error?
Replies: 4
Views: 657

Re: Can anybody help with this Error?

thanks it already worked, I only changed the GPIO number and used [17,27]
by luiskrlos84
Thu Mar 30, 2017 11:20 pm
Forum: Beginners
Topic: Can anybody help with this Error?
Replies: 4
Views: 657

Re: Error

DirkS wrote:Did you name your script 'pigpio.py'?
If that's the case then you will have to rename it, as it confuses python. It will find your script instead of the installed pigpio module
No I named the script servo-4.py
by luiskrlos84
Thu Mar 30, 2017 11:04 pm
Forum: Español
Topic: Dos servomotor
Replies: 1
Views: 336

Dos servomotor

Tienen algun código que funcione de como controlar 2 servomotor, solo eh conseguido mover uno solo pero necesito mover 2, gracias
by luiskrlos84
Thu Mar 30, 2017 10:51 pm
Forum: Beginners
Topic: 2 Servo Motor Control
Replies: 4
Views: 2907

Re: 2 Servo Motor Control

Servo motors are also analog, they will rarely rotate at the same speed unless you make them by slicing up the steps. To move to +90 degrees from 0 degrees that means changing the pulse width from 1.5ms to 2ms. Do it in steps, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0ms, allow time for each servo to move to tha...
by luiskrlos84
Thu Mar 30, 2017 10:38 pm
Forum: Beginners
Topic: Can anybody help with this Error?
Replies: 4
Views: 657

Can anybody help with this Error?

This is my code: import time import pigpio servos = [4,7] #GPIO number pigpio.start() #pulsewidth can only set between 500-2500 try: while True: pigpio.set_servo_pulsewidth(servos[0], 500) #servo 1 to 0 degree print("Servo {} {} micro pulses".format(servos, 500)) time.sleep(1) pigpio.set_servo_pulse...
by luiskrlos84
Mon Mar 27, 2017 10:36 pm
Forum: Beginners
Topic: 2 Servo Motor Control
Replies: 4
Views: 2907

2 Servo Motor Control

We want to control two servo motors to do the same function to rotate 180 degrees and then comeback to the original position, but we are having trouble syncin the second motor with the first motor. We were able to make the first one rotate 180 degrees, we only need to add the second motor. We are us...

Go to advanced search