The compiler is not lying. There is no function named sine8() in your sketch and the one in the Adafruit library takes a byte as its argument rather than an int
/*!
@brief An 8-bit integer sine wave function, not directly compatible
with standard trigonometric units like radians or degrees.
@param x Input angle, 0-255; 256 would loop back to zero, completing
the circle (equivalent to 360 degrees or 2 pi radians).
One can therefore use an unsigned 8-bit variable and simply
add or subtract, allowing it to overflow/underflow and it
still does the expected contiguous thing.
@return Sine result, 0 to 255, or -128 to +127 if type-converted to
a signed int8_t, but you'll most likely want unsigned as this
output is often used for pixel brightness in animation effects.
*/
static uint8_t sine8(uint8_t x) {
return pgm_read_byte(&_NeoPixelSineTable[x]); // 0-255 in, 0-255 out
}
Your code
for (int i = 0; i < 255; i++)
{
// Testing sine8
float intensity = sine8(i);
Note that if you really wanted to you could have 2 different functions with the same name each taking parameters of different types and each with different code. C++ allows this and which version of the function is called depends on the parameter type passed to the function
This is why you got the original error. The function name was OK but the parameter type was wrong, hence "function not defined"
This is not the issue. For better or for worse, int is implicitly converted to byte.
Passing an argument of the wrong type would also result in a different error message.
The reason for OP's error is that the sine8 is not a free function, but a static member function: you have to call it as Adafruit_NeoPixel::sine8(i), as mentioned by oqibidipo.