ATTiny85 - AnalogWrite - How to reference pins

Hello,

Im trying to use PWM on ATTINY85.

Is this the correct way to reference PWM on the ATTINY85?

analogWrite(PB1, x);

where x = an integer value?

Note: I'm using the AttinyCore.

analogWrite(x, y);

x can either be 0 or 1. 0 is pin 5, 1 is pin 6
y can be 0 - 255

// generate pwm output on pin 5 at 50% duty cycle
analogWrite(0, 127); 
1 Like

Awesome! Thanks.
That works now, referencing pin 6 (analogWrite(1,X)) instead of referencing it as PB1

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.