Go Down

Topic: Firmata and PWM (Read 988 times) previous topic - next topic

Dudley Smith

Hi,

I have a (simple ?) question : how can i set all pwm pins in pwm outputs ?

I control my arduino Mega from an application and can not send pwm on pin 1,2.
It seems to be something in firmata, but is there an existing firmata to free pin 1 and 2 for pwm ?

Cheers.

Sebastien


PaulS

Pin 1 is the Serial pin. It is not a PWM pin.

Dudley Smith

And could never be, i guess, as pin0 ?

PaulS

Quote
And could never be, i guess, as pin0 ?

I'm not sure what that means. Pins 0 and 1 are the hardware serial pins that Firmata uses to talk to the PC or other device driving it.

They are not PWM pins in any case.

Quote
Pins 0 and 1 are the hardware serial pins that Firmata uses to talk to the PC or other device driving it.


That's right.  There are only a certain amount of pins that are PWM capable.  That's because the timers that have the PWM module have certain pins assigned to them (you will find those pins in the datasheet labeled, for example, OCR0A).

The PWM pins are labeled on the Arduino board with a little squiggly line beside the pin number.

PaulS

Quote
The PWM pins are labeled on the Arduino board with a little squiggly line beside the pin number.

Not on a Mega.  8)

Yeah you're right.  I see it's pins 2-13 only.  http://arduino.cc/en/Reference/AnalogWrite

Go Up