This is the code with the servo object changed from the standard BOE to the servo32 object. That is the only change I made. It still compiles, but there is no change in the behavior. Do you guys know how I would have to change the syntax to use servo32 to specifically split up the servo tasks among the different cogs?
On another note:
I mentioned earlier that if only one servo is plugged in but it slows down if a second one is plugged in on another pin.) This morning I tried using a y splitter and plugging in two servos into 1 pin. This STILL caused a slow down in the response time of the servos. I am stumped by that. I know that it isn't a power issue. I run 4 servos off of 4AA's with y splitters all the time.
I wonder if it's "browning out"? When they start moving servos pull quite a lot of power, and under load they can also pull quite a bit. If you don't have a buffering capacitor on the servo lines it could be that it's stealing power from the prop and causing it to reboot. That would easily cause the second or two lag you're seeing. Try putting a 1000uf capacitor (10v or better) across the pins for power and ground where you plug in the servos.
If I were you, I'd add an MCP3208 12 bit eight channel ADC, and get rid of RCTime.
Currently I use:
- one cog to control up to 24 servos and/or PWM output for DC gear motorss with PWM_32_v4.spin (found it in Obex)
- one cog to control the MCP3208 ADC with ADC_INPUT_DRIVER.spin (search for MCP3208 in Obex)
- one cog to run FullDuplexSerial
- one cog for the overall robot app
Leaving me with four free cogs for future use
A prop should be more than fast enough for your application.
Comments
I will try that this morning!
This is the code with the servo object changed from the standard BOE to the servo32 object. That is the only change I made. It still compiles, but there is no change in the behavior. Do you guys know how I would have to change the syntax to use servo32 to specifically split up the servo tasks among the different cogs?
On another note:
I mentioned earlier that if only one servo is plugged in but it slows down if a second one is plugged in on another pin.) This morning I tried using a y splitter and plugging in two servos into 1 pin. This STILL caused a slow down in the response time of the servos. I am stumped by that. I know that it isn't a power issue. I run 4 servos off of 4AA's with y splitters all the time.
Maybe it's not a software issue. Can you post pictures of your setup, diagrams , schematics, etc that could be helpful?
If I were you, I'd add an MCP3208 12 bit eight channel ADC, and get rid of RCTime.
Currently I use:
- one cog to control up to 24 servos and/or PWM output for DC gear motorss with PWM_32_v4.spin (found it in Obex)
- one cog to control the MCP3208 ADC with ADC_INPUT_DRIVER.spin (search for MCP3208 in Obex)
- one cog to run FullDuplexSerial
- one cog for the overall robot app
Leaving me with four free cogs for future use
A prop should be more than fast enough for your application.