Skip to content

Commit 8941bc8

Browse files
committed
Fix for ESP32 lack of 'analogWrite'
1 parent f3d12ae commit 8941bc8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/HyperDisplay_KWH018ST01_4WSPI.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,15 @@ void KWH018ST01_4WSPI::setWindowDefaults(wind_info_t * pwindow)
203203
}
204204

205205
void KWH018ST01_4WSPI::setBacklight(uint8_t b){
206+
#if defined(ARDUINO_ARCH_ESP32)
207+
if(b > 127){
208+
digitalWrite(_bl, HIGH);
209+
}
210+
else{
211+
digitalWrite(_bl, LOW);
212+
}
213+
#else
206214
analogWrite(_bl, b);
215+
#endif
207216
}
208217

0 commit comments

Comments
 (0)