myservo.detach() not releasing PWM on Digital pins 9 & 10

(deleted)

GunnerGunner:
The shield has a fixed pin arrangement

That's exactly why I hate the use of shields

Presumably you servo.detach()'ed all the servos?

I must say I had never read the part that says servo.detach() gives pin 9 and 10 their PWM back, but that (to me anyway) conflicts with the main servo page, where it says...

On boards other than the Mega, use of the library disables analogWrite() (PWM) functionality on pins 9 and 10

I always took that to mean that the mere presence of the line...

#include <Servo.h>

... meant you were using the library, so that took away the PWM from pins 9 and 10.

(deleted)

GunnerGunner:
The PWM function of pins 9 & 10 do not get disabled until actually calling the myservo.attach(x) command.

Yeah I just verified that, and also verified the problem that you don't get PWM back on 9 and 10 if you detach all the servos. I just used the IDE's fade sketch to fade an LED on 9, 10 and 11. Works fine until I attached a servo to pin 7, then only the fade on 11 worked, as expected. Detaching the only servo didn't fix 9 and 10.

Maybe you need a Mega? Or think of some kind of distributed processing?

Afterthought: The Analog pins are actually digital, and can run servos. You using them?

(deleted)

(deleted)

My question remains though: what about the analog pins A0-A5 as digital?- you doing that, or are they used as analog input already?

(deleted)

GunnerGunner:
Oh, sorry... I thought you had noted that I was using the Diyode CodeShield... it is chock full of devices, so ALL pins are in use (well except 4, 7 and 8 but I had to manually break them out)... so, no, Analog pins are all full up.

I'm not sure from its product page what the analog pins are used for though- and notwithstanding what you said about the thread being about that glitch, it's worth remembering that pins A0-A5 are digital.

As a matter of interest are you sure the analog pins are used? Apart from the pot and the ldr, that is.

In the pic on the page you linked there are no headers, so how do you attach anything to the unused pins?

I would like that product a zillion times more if it wasn't a shield, and could be wired in any way the user likes. I actually made a strip board with a small display, RTC and EEPROM (all I2C), and a couple of leds and buttons, and buzzer and couple of pots, but all with wires so I can attach it how I like.

Presumably that servo is hardwired for power to the Arduino 5V?- that's not wise, if it is.

(deleted)

2017-01-12 01.28.55.jpg

GunnerGunner:
This is a shield for programming and education use; Focus on the software debugging, not the hardware debugging, type thing.

Yep I get that, it's quite nice.

GunnerGunner:
Just order the kit and use jumper wires instead of the header pins.

I'm actually planning a bigger "general purpose control panel" because I keep losing stuff.

It will likely have:

I2C LCD with buttons built in and managed by the adafruit library
I2C RTC
LEDs of various colours and a couple of RGBs
A couple of 7-segs
An xy joystick
A micro servo
Loads of 3V, 5V and Gnd connections
Loads of buttons and switches
Breadboard glued down so I don't take it somewhere else
Some permanently mounted logic level mosfets (so they don't get lost)

.... and who knows what else will be a good idea?