Hello all!
I am making a project with the DFRobot HT1632 display. I try to compile the demo code though, and I get a list of errors that I have no idea how to fix. The whole list of errors seem to be very similar; something to do with a wrong "min" functions in the library... maybe?
Does anyone have any ideas on how to fix the errors and get this code compiling?
Thanks in advance!
Code:
#include "DFRobot_HT1632C.h"
#define DATA 10 //D6
#define CS 9 //D5
#define WR 13 //D7
DFRobot_HT1632C ht1632c = DFRobot_HT1632C(DATA, WR,CS);
char str[] = "DFROBOT 2017";
void setup() {
Serial.begin(115200);
// put your setup code here, to run once:
ht1632c.begin();
ht1632c.isLedOn(true);
ht1632c.clearScreen();
delay(500);
}
void loop() {
// put your main code here, to run repeatedly:
ht1632c.print(str,50);
//delay(100);
}
Error:
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp: In member function 'void DFRobot_HT1632C::drawImage(const byte*, uint8_t, uint8_t, int8_t, int8_t, int)':
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:464:57: error: no matching function for call to 'min(uint8_t&, int)'
copyInNextStep = min(copyInNextStep, (height - src_y));
^
In file included from /Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/algorithm:62,
from /Users/user/Library/Arduino15/packages/DFRobot/hardware/esp32/0.2.1/cores/esp32/Arduino.h:145,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.h:17,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:13:
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algo.h:3456:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)'
min(initializer_list<_Tp> __l, _Compare __comp)
^~~
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algo.h:3456:5: note: template argument deduction/substitution failed:
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:464:57: note: mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
copyInNextStep = min(copyInNextStep, (height - src_y));
^
In file included from /Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/algorithm:62,
from /Users/user/Library/Arduino15/packages/DFRobot/hardware/esp32/0.2.1/cores/esp32/Arduino.h:145,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.h:17,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:13:
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algo.h:3450:5: note: candidate: 'template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)'
min(initializer_list<_Tp> __l)
^~~
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algo.h:3450:5: note: template argument deduction/substitution failed:
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:464:57: note: mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
copyInNextStep = min(copyInNextStep, (height - src_y));
^
In file included from /Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/algorithm:61,
from /Users/user/Library/Arduino15/packages/DFRobot/hardware/esp32/0.2.1/cores/esp32/Arduino.h:145,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.h:17,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:13:
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algobase.h:243:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algobase.h:243:5: note: template argument deduction/substitution failed:
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:464:57: note: deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
copyInNextStep = min(copyInNextStep, (height - src_y));
^
In file included from /Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/algorithm:61,
from /Users/user/Library/Arduino15/packages/DFRobot/hardware/esp32/0.2.1/cores/esp32/Arduino.h:145,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.h:17,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:13:
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algobase.h:195:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
min(const _Tp& __a, const _Tp& __b)
^~~
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algobase.h:195:5: note: template argument deduction/substitution failed:
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:464:57: note: deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
copyInNextStep = min(copyInNextStep, (height - src_y));
^
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp: In member function 'void DFRobot_HT1632C::drawImageStr(const byte*, uint8_t, uint8_t, int8_t, int8_t, int)':
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:506:57: error: no matching function for call to 'min(uint8_t&, int)'
copyInNextStep = min(copyInNextStep, (height - src_y));
^
In file included from /Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/algorithm:62,
from /Users/user/Library/Arduino15/packages/DFRobot/hardware/esp32/0.2.1/cores/esp32/Arduino.h:145,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.h:17,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:13:
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algo.h:3456:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)'
min(initializer_list<_Tp> __l, _Compare __comp)
^~~
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algo.h:3456:5: note: template argument deduction/substitution failed:
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:506:57: note: mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
copyInNextStep = min(copyInNextStep, (height - src_y));
^
In file included from /Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/algorithm:62,
from /Users/user/Library/Arduino15/packages/DFRobot/hardware/esp32/0.2.1/cores/esp32/Arduino.h:145,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.h:17,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:13:
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algo.h:3450:5: note: candidate: 'template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)'
min(initializer_list<_Tp> __l)
^~~
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algo.h:3450:5: note: template argument deduction/substitution failed:
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:506:57: note: mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
copyInNextStep = min(copyInNextStep, (height - src_y));
^
In file included from /Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/algorithm:61,
from /Users/user/Library/Arduino15/packages/DFRobot/hardware/esp32/0.2.1/cores/esp32/Arduino.h:145,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.h:17,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:13:
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algobase.h:243:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algobase.h:243:5: note: template argument deduction/substitution failed:
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:506:57: note: deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
copyInNextStep = min(copyInNextStep, (height - src_y));
^
In file included from /Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/algorithm:61,
from /Users/user/Library/Arduino15/packages/DFRobot/hardware/esp32/0.2.1/cores/esp32/Arduino.h:145,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.h:17,
from /Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:13:
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algobase.h:195:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
min(const _Tp& __a, const _Tp& __b)
^~~
/Users/user/Library/Arduino15/packages/DFRobot/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2020r3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_algobase.h:195:5: note: template argument deduction/substitution failed:
/Users/user/Desktop/Arduino/libraries/DFRobot_HT1632C/DFRobot_HT1632C.cpp:506:57: note: deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
copyInNextStep = min(copyInNextStep, (height - src_y));
^
exit status 1
Error compiling for board FireBeetle ESP32-E.