TVout and Nunchuk

I'm using TVout and the controllers library from nootropic design's hackvision with a nunchuk. Here's my code:

#include <Controllers.h>
#include <TVout.h>
#include <video_gen.h>

TVout tv;

boolean useNunchuk = false;


void setup() {
  tv.begin(_NTSC,184,72);
  useNunchuk = boolean(Nunchuk.init(tv, 4));
}

void loop() {
  if (useNunchuk) {
    Nunchuk.getData();

  }
  if(Nunchuk.getButtonC() == 1) {
    tv.fill(2);
  }

}

It compiles fine, but it won't work. I debugged it and found out that the program is stopping at the second line of the setup function (useNunchuk = ...).

Any ideas?

Thanks in advance!
baum

When you say ´stopping at´ do you mean before or after the line you provided?

I put in "debug points" where the arduino would flash an LED. I put one after each function line of code, but if only blinked once (after "tv.begin(..etc..."). The debug LED for the next line didn't go.

I tried everything independently: my nunchuk works, TVout works, so it must be a problem with the controllers library.

Thanks!
baum

Why on earth are you using this line (which is clearly the issue):?

  useNunchuk = boolean(Nunchuk.init(tv, 4));

The init function returns a 1 or a 0, no need to do anything special. Is there even such a function as boolean()?
Why are you not just using:
  useNunchuk = Nunchuk.init(tv, 4);???

Sorry about that... it was an attempt to get it to work. But either way it doesn't work.

And the init() function initializes the controller, then returns a 1 or 0 if the nunchuk is connected.

Have you tried using any one of the demos from the nootropics website?

I don't have a hackvision, I'm using a duemilanove, but I suppose I could try it.

That is exactly what you should do. The hackvision is just an arduino clone with some extra hardware to make interfacing easier.

OK. And I just realized that the hackvision is built around an older version of TVout...I'll try that one.