Skip to content

How to use PWM ? #31

@Witawat

Description

@Witawat

How to use PWM ?

i try analogWrite() not work

#include <Arduino.h>

/* PC1 as blinky LED, change here as needed */
#define LED PD2

void setup() {
    pinMode(LED, OUTPUT);
    analogWriteFrequency(20000);
}

void loop() {
//    digitalWrite(LED, HIGH);
//    delay(500);
//    digitalWrite(LED, LOW);
//    delay(500);

    analogWrite(LED, 100);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions