Compare commits
3 Commits
374fcee02f
...
0d73d112b1
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d73d112b1 | |||
| 9c49004fda | |||
| a0b3ace3e6 |
@ -8,17 +8,37 @@
|
|||||||
; Please visit documentation for the other options and examples
|
; Please visit documentation for the other options and examples
|
||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[env:esp32dev]
|
[basic]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps = https://github.com/adafruit/Adafruit_NeoPixel
|
lib_deps = https://github.com/adafruit/Adafruit_NeoPixel
|
||||||
https://github.com/knolleary/pubsubclient
|
https://github.com/knolleary/pubsubclient
|
||||||
build_flags =
|
build_flags =
|
||||||
upload_port = 10.0.0.116
|
|
||||||
upload_protocol = espota
|
|
||||||
;upload_port = /dev/ttyUSB0
|
|
||||||
;upload_speed = 921600
|
|
||||||
monitor_port = /dev/ttyUSB0
|
monitor_port = /dev/ttyUSB0
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
monitor_filters = esp32_exception_decoder
|
monitor_filters = esp32_exception_decoder
|
||||||
|
|
||||||
|
[env:RGBMatrixDisplay_USB]
|
||||||
|
platform = ${basic.platform}
|
||||||
|
board = ${basic.board}
|
||||||
|
framework = ${basic.framework}
|
||||||
|
lib_deps = ${basic.lib_deps}
|
||||||
|
build_flags = ${basic.build_flags}
|
||||||
|
monitor_port = ${basic.monitor_port}
|
||||||
|
monitor_speed = ${basic.monitor_speed}
|
||||||
|
monitor_filters = ${basic.monitor_filters}
|
||||||
|
upload_port = /dev/ttyUSB0
|
||||||
|
upload_speed = 921600
|
||||||
|
|
||||||
|
[env:RGBMatrixDisplay_OTA]
|
||||||
|
platform = ${basic.platform}
|
||||||
|
board = ${basic.board}
|
||||||
|
framework = ${basic.framework}
|
||||||
|
lib_deps = ${basic.lib_deps}
|
||||||
|
build_flags = ${basic.build_flags}
|
||||||
|
monitor_port = ${basic.monitor_port}
|
||||||
|
monitor_speed = ${basic.monitor_speed}
|
||||||
|
monitor_filters = ${basic.monitor_filters}
|
||||||
|
upload_port = 10.0.0.116
|
||||||
|
upload_protocol = espota
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public:
|
|||||||
const int value = (int) round(abs(valueDbl));
|
const int value = (int) round(abs(valueDbl));
|
||||||
const bool negative = valueDbl < 0;
|
const bool negative = valueDbl < 0;
|
||||||
|
|
||||||
const int digitCount = (int) max(1.0, ceil(log10(value))); // log10 is -inf for value==0, hence the max(1.0, ...)
|
const int digitCount = (int) max(1.0, floor(log10(value)) + 1); // log10 is -inf for value==0, hence the max(1.0, ...)
|
||||||
if (align == RIGHT) {
|
if (align == RIGHT) {
|
||||||
x -= ((negative ? 1 : 0) + digitCount) * (DISPLAY_CHAR_WIDTH + 1) - 1;
|
x -= ((negative ? 1 : 0) + digitCount) * (DISPLAY_CHAR_WIDTH + 1) - 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user