Attiny13A without PWM

Attiny13A uses MicroCore 2.3.0. I download the code through the programmer. My PWM does not work, it is not on any contact (I am a beginner), what could be the problem? Here is the code:

#define npn 1
#define btn_1 2
#define btn_2 3

byte value = 0;

void setup(){
  pinMode(npn, OUTPUT);
  pinMode(btn_1, INPUT);
  pinMode(btn_2, INPUT);
}

void loop(){
  if(digitalRead(btn_1) == 1){
    if(value < 255){
      value++;
      analogWrite(npn, value);
    }
  }
  if(digitalRead(btn_2) == 1){
    if(value != 0){
      value--;
      analogWrite(npn, value);
    }
  }
  delay(50);
}

Please explain what you expected to happen, what happened instead, and what you have done to debug the problem.

Also post a pic of a hand drawn wiring diagram, with pins, parts and connections clearly labeled.

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