Skip to content

Commit 5076ab2

Browse files
author
Stefania
authored
Merge pull request #207 from per1234/analogWriteResolution-example-bug
Fix bug in 4 bit section of analogWriteResolution() example code
2 parents 871dc31 + ff50e82 commit 5076ab2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Language/Functions/Zero, Due, MKR Family/analogWriteResolution.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ void loop(){
108108
109109
// change the PWM resolution to 4 bits
110110
analogWriteResolution(4);
111-
analogWrite(13, map(sensorVal, 0, 1023, 0, 127));
111+
analogWrite(13, map(sensorVal, 0, 1023, 0, 15));
112112
Serial.print(", 4-bit PWM value : ");
113-
Serial.println(map(sensorVal, 0, 1023, 0, 127));
113+
Serial.println(map(sensorVal, 0, 1023, 0, 15));
114114
115115
delay(5);
116116
}

0 commit comments

Comments
 (0)