This is an old revision of the document!
NOTE: These features are only present in Digistump Arduino IDE Release 1.5.8C and higher
The Digispark Pro supports 2 channels of PWM (timers) that can be connected to 3 pins (channel A) or 2 pins (channel B) - the output must be the same on all pins that share the same channel and any, many, all or no pins can be connected to the channel.
See the pinout diagram for which pins correspond to which channels: http://digispark.s3.amazonaws.com/DigisparkProDiagram2.png
The standard Arduino analogWrite function works with the Pro. Using analogWrite(pin,value) where pin is the pin number, and value is the PWM value you want to set that pin to - works just like a regular Arduino and sets that pin to that value and disconnects all other pins on that channel from the PWM channel. This means with analogWrite you can have one pin on each channel active at a time.
The Digispark Pro also has the following special functions available for use with the PWM functionality:
pwmWrite(channel,value);
Where “channel” is either “CHANNELA” or “CHANNELB” and value is a value from 0-255 to set that PWM channel to ex) pwmWrite(CHANNELA,125);
This sets that channel (or timer) to the PWM value specified and it will be output to any pins you connect with the pwmConnect() function.
pwmConnect(pin);
Where pin is the pin number (0,1,2,3, or 4) that you want to connect to its PWM channel.
pwmDisconnect(pin);
Where pin is the pin number (0,1,2,3, or 4) that you want to disconnect from its PWM channel.
pwmReset();
Disconnect all pins from their PWM channel.