Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hardware/arduino/avr/cores/arduino/wiring_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ void analogWrite(uint8_t pin, int val)
// for consistenty with Wiring, which doesn't require a pinMode
// call for the analog output pins.
pinMode(pin, OUTPUT);
if (val == 0)
if (val <= 0)
{
digitalWrite(pin, LOW);
}
else if (val == 255)
else if (val >= 256)
{
digitalWrite(pin, HIGH);
}
Expand Down