-->
Page 4 of 19

Re: RGB Controller for Apple HomeKit and Siri (NodeMCU-ESP82

PostPosted: Wed Feb 22, 2017 3:12 am
by eqsOne
You're welcome! The 'max' parameter calculates the maximum of two numbers. If 'math.h' is properly included it should actually compile:

Code: Select all#include <math.h>

___________________
Edit: Hmm, just googled this and there seems to be an issue with 'min/max' in IDE 1.6.5. indeed. Not even sure if math.h is actually needed for 'min/max' to work.
Anyway, seems you can try adding the 'max' definition directly to the sketch like this:

Code: Select all#define max(a,b) ((a)>(b)?(a):(b))

Re: RGB Controller for Apple HomeKit and Siri (NodeMCU-ESP82

PostPosted: Wed Feb 22, 2017 4:05 pm
by eqsOne
Strange. Actually I'm using 1.6.5 on OSX and it compiles fine, even without math.h. Let me know if you could solve the issue.

Re: RGB Controller for Apple HomeKit and Siri (NodeMCU-ESP82

PostPosted: Sat Feb 25, 2017 8:16 am
by J6r06n
Thank you for this awesome tutorial. I had to ad these three lines in your program because my esp8266 has a 10 bit pwm output:
Code: Select allr = map(r, 0, 255, 0, 1023);
g = map(g, 0, 255, 0, 1023);
b = map(b, 0, 255, 0, 1023);

Re: RGB Controller for Apple HomeKit and Siri (NodeMCU-ESP82

PostPosted: Sun Feb 26, 2017 9:02 am
by eqsOne
You're welcome! Nice variation, thanks for posting this.