Open rajil opened 6 years ago
The ESP8266 library is version 2.4.1.
https://github.com/kitesurfer1404/WS2812FX/issues/58
Looks to be this issue - nodemcu v. 2.4.0 replaced the macros (which admittedly have problems if people do daft things, eg. calling max(foo++, bar++)
) with functions std::min and std::max which barf if the two arguments are not the same type.
Can you try these two fixes:
PingSerial.h:107 Change
uint16_t _max_op_duration_ms = 0;
to
unsigned long _max_op_duration_ms = 0;
PingSerial.c:195 Change
_timeout_count = max(_timeout_count, 1);
to
_timeout_count = max(_timeout_count, (uint16_t )1);
Thanks, with these changes the code compiles. However, I dont see data being read from the nodemcu v3. What pins on nodemcuv3 should i connect the Trigger and Echo pins?
I've never used this with nodemcu boards, only Arduino/Atmega boards. Conceptually you just need to use any pins that handle hardware serial (which are fixed for the board, see the block diagram) or it is possible you can use SoftwareSerial library and use many more pins.
Have you got the jumper set right for the US-100 to output serial data (vs. the trigger/echo method)? I think if the jumper is present it will use serial.
Rather than using the library, I suggest you connect your US-100 with a very basic program that just passes through whatever your computer or the nodemcu is sending. Then send some test messages to see if the US-100 responds.
Sorry, I can't help much more than that - I don't have a device to test with nor the time to do it ATM :)
Fix proposal in PR #7
I tried to compile the example for a nodemcu, and got a bunch of errors. Any idea what is the issue?