PWM not working always HIGH or LOW 2.1 git version
Posted: Thu Jan 07, 2016 7:27 am
Hi,
PWM not working always HIGH or LOW 2.1 git versionĀ
SDK 1.5
int ledPin = 5; // LED connected to digital pin 5
void setup() {
pinMode(ledPin, OUTPUT);
analogWriteRange(255);
}
void loop() {
for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) {
analogWrite(ledPin, fadeValue);
delay(30);
}
for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) {
analogWrite(ledPin, fadeValue);
delay(30);
}
}
Led high or low
PWM not working always HIGH or LOW 2.1 git versionĀ
SDK 1.5
int ledPin = 5; // LED connected to digital pin 5
void setup() {
pinMode(ledPin, OUTPUT);
analogWriteRange(255);
}
void loop() {
for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) {
analogWrite(ledPin, fadeValue);
delay(30);
}
for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) {
analogWrite(ledPin, fadeValue);
delay(30);
}
}
Led high or low