diff --git a/library.properties b/library.properties index d851b0cd6..7b31700e2 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Adafruit WipperSnapper -version=1.0.0-beta.100 +version=1.0.0-beta.101 author=Adafruit maintainer=Adafruit sentence=Arduino application for Adafruit.io WipperSnapper diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index 776eca217..b5013d6df 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -142,7 +142,7 @@ #endif #define WS_VERSION \ - "1.0.0-beta.100" ///< WipperSnapper app. version (semver-formatted) + "1.0.0-beta.101" ///< WipperSnapper app. version (semver-formatted) // Reserved Adafruit IO MQTT topics #define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic diff --git a/src/components/ledc/ws_ledc.cpp b/src/components/ledc/ws_ledc.cpp index 7416077bc..2159e0d52 100644 --- a/src/components/ledc/ws_ledc.cpp +++ b/src/components/ledc/ws_ledc.cpp @@ -54,7 +54,8 @@ bool ws_ledc::analogWrite(uint8_t pin, int value) { // Calculate duty cycle for the `value` passed in // (assumes 12-bit resolution, 2^12) - uint32_t dutyCycle = (4095 / 255) * min(value, 255); + uint32_t dutyCycle = + (uint32_t)(((double)4095 / 255.0) * min((uint32_t)value, (uint32_t)255)); // Call duty cycle write return setDuty(pin, dutyCycle);