Going back to this, I'm wondering if you plugged 2 servos into a single output port of the PCA9685.
Yes, I used a Y connector to join 2 servos together, both driven by pin 4 on the PCA9685. Not a good idea? Ok, that might explain why 4 and 5 are acting up, but would that explain the action of 1, 2 and 3?
David
but would that explain the action of 1, 2 and 3?
If the PCA has issues with one port, it may affect it's whole behaviour ?
Eric
Ah, I see. Ok I'll modify and try again tomorrow (it's 11pm here) and let you know. I hope you're right. I'd really like to get this solved and move on. It's driving me bonkers ?
David
I use One switch to switch 2 servos but they are on different channels on the PCA9685 i.e as I have a scissor crossing which has 4 points so to swap track in one direction I have 2 points and same for the other way ... so on my sketch the scissor data input pins are 27,28,29,30 and output channel is 5, 6, 7 and 8 and I have 4 microswitches on point mounts to lock One switch if 1 scissor is open in One direction it wont allow the other to open... I can only switch when all are in straight ahead mode..
Just having another go at checking things ... having to re-make 2 ribbon cables a 25way and a 9 way as this house rabbit we have had a chew at the ribbon cables yesterday ... anybody like rabbit casserole.. LOL
John
this house rabbit we have had a chew at the ribbon cables
? Sadly I don't find any spec on the PCA9685 datasheet about rabbit resiliency !
EDIT: But I found the rabbit's datasheet : https://noseychef.com/2019/02/27/lapin-a-la-moutarde/
Eric
? Sadly I don't find any spec on the PCA9685 datasheet about rabbit resiliency !
That looks nice, but only jokeing about rabbit we love her she does have a health problem not sure what happened but she has a cist or lump full of puss on her forehead we think dog may have bit her and we press on it and comes down her rigth nostral problem is rabbits breath through their nose ... anyway back to trains just finish test on the points on PCA9685 all know work but had another bad one was jammed think these SG90 servo's are crap but other are double the price see how it goes on that... so will put your newest sketch on Polarity Mega tomorrow and see if everything switches the correct direction and LED's on Mimic panel..
If the PCA has issues with one port, it may affect it's whole behaviour ?
It appears that you are correct. Even my sketch worked correctly after I separated servos 4 and 5. But I'm stil having issues with the PCA9685.
I've discovered another sketch on the Arduino forum originally by PaulDMV, then modified by Anders53 and Septillion called MultiServo4-2-2.ino. It doesn't use the PCA9685 but it limited to 8 servos. I'm evaluating that one now, with success. Maybe the best solution is to give up on the PCA9685 and just use 2 Arduinos where I'm using 16 servos. I could paste the sketch here, if you like. Or I could paste a link, if I knew how.
How many servos with the Arduino Uno handle without needing a separate power supply? Does the same gos for a Mega?
David
How many servos with the Arduino Uno handle without needing a separate power supply?
For power I would go for 0 = none = nada !
A servo may use current in hundreds of mA while the Arduinos can only give 40mA absolute max (recommended = 20mA !) on each pin, with a total maximum which depends on model.
You can check the specs of each model here.
Beware of sketches using the original Servo library : IIRC, the library uses at least one of the 2 timers available on the Uno (the Mega has more timers).
Eric
Yes as discussed through another channel, the use of arrays enables to go up to the 16 ports of a PCA9685.
The initialized arrays MUST have the exact number of values per servo (nb.=NUMBER_OF SERVOS).
Here is a small variation of the sketch where the prevMillis[] array does not need to be statically initialized :
Eric
Hi Eric,
Yes I understand about changing to 16 channels and the pin No need adding and the left and Right limits need adding for each ... but a few lines down you have this ...
unsigned long prevMillis[NB_OF_SERVOS] = { 0UL, 0UL, 0UL, 0UL, }; //
so does this need extending as well another 12 times i.e the 0UL..
John
does this need extending as well
Not with the V2 of the sketch, it is now just a declaration as the initialization is done by setup()
Eric
Sad to say but on that stay in England during the mid 50s where I got to learn the skill of pin setting at the local bowling alley, I also got to see plenty of the rabbits afflicted with Myxomatosis as referenced in your link to 'Lapin à la moutarde' above.
SteveG
I spotted this in a high street butcher's shop in Newport, Gwent, just after the film "Watership Down" had hit the cinemas.
You've read the book!
You've seen the film!
Now, EAT the cast!
? ? ?
Yes I remember the same sorry sight from 30-40 years ago when hunting we killed the poor beasts and burned them, while other guys were busy re-inoculating the disease all the while for money !
/hate
Eric