Invalid use of void expression

I get the above error at line 10 when compiling this code:

#include <Wire.h>
#include <nunchuck_funcs.h>

#include <TVout.h>
TVout TV;

void setup() {
  nunchuck_setpowerpins();
  nunchuck_init();
  TV.begin(_NTSC);
  TV.set_vbi_hook(nunchuck_get_data()); //right here
  pinMode(12, INPUT);
}

void loop() {
  TV.set_pixel(nunchuck_joyx(), nunchuck_joyy(), 1);
  TV.delay(10);
}

Anyone familiar with TVout have any ideas? The get_data function is of void type, so I don’t understand the problem.

If you are supposed to pass a function to TV.set_vbi_hook you would use nunchuck_get_data, not nunchuck_get_data().

The get_data function is of void type, so I don't understand the problem.

What that means is that the function does not return a value. You are trying to use the value returned by the function (when there isn't one) as the required argument for TV.set_vbi_hook().

Thanks!

but I just realized that using vbi_hook is to fast for get_data, so I'll find a slower way of doing it.

You could make a routine that calls nunchuck_get_data() every Nth time it's called. That would slow the request rate to a reasonable level.

Actually, I can make it a lot simpler and just put a delay after the get_data(). Duh.

Thanks for the help!