Welcome! Log In Create A New Profile

Advanced

Wiilight help?

Posted by gamerjr 
Wiilight help?
January 23, 2009 04:34AM
Ok i might new to the Wii programming but i think i have this right...
//light crap
void WIILIGHT_Init();
void WIILIGHT_TurnOn();
int WIILIGHT_GetLevel();
int WIILIGHT_SetLevel(int level);
 
void WIILIGHT_Toggle();
void WIILIGHT_TurnOff();
//end light crap
WIILIGHT_Init();
WIILIGHT_SetLevel(255);
WIILIGHT_TurnOn();
sleep(3);
WIILIGHT_TurnOff();
my errors are that the WIILIGHT_TurnOn is undefined... (i miss PHP so much easier) im just trying to get started any advice?



Edited 1 time(s). Last edit at 01/23/2009 04:35AM by gamerjr.
Re: Wiilight help?
January 23, 2009 08:22AM
Sounds like you don't have the needed functions in any of the linked with libraries. Are you sure that these ones does in fact exist in those? Check if you need a fresher version or maybe even yet another library.
Re: Wiilight help?
June 30, 2009 11:29PM
Ok. I'm having a very similar issue to this. I am not new to programming but I am getting this noob error. Maybe somebody can tell me what I forgot to do.

I am trying to use the wiilight library from wiibrew.
I have put the .h and .a files in the right folders in devkit.
I said #include at the top of main.c.
I put this line in the main function after the video_init()...
WIILIGHT_Init();

I get this stupid error when I compile...
j:/code/poopie/source/main.cpp:124: undefined reference to `WIILIGHT_Init()'

Did I miss something obvious anybody? Was I supposed to put it in the makefile also?
Re: Wiilight help?
July 01, 2009 12:07AM
If you want to turn the light on and off. Just use this code:
static vu32 *_wiilight_reg = (u32*)0xCD0000C0;

/**
 * Turn Wii light off
 */
void WIILIGHT_TurnOff()
{
    *_wiilight_reg &= ~0x20;
}

/**
 * Turn Wii light on
 */
void WIILIGHT_TurnOn()
{
    *_wiilight_reg |= 0x20;
}
Re: Wiilight help?
July 01, 2009 04:58AM
I am already using this code. I was wanting to use the library because it allows setting the intensity so it allows fading and what not.
Re: Wiilight help?
July 01, 2009 03:03PM
Quote
giantpune
Ok. I'm having a very similar issue to this. I am not new to programming but I am getting this noob error. Maybe somebody can tell me what I forgot to do.

I am trying to use the wiilight library from wiibrew.
I have put the .h and .a files in the right folders in devkit.
I said #include at the top of main.c.
I put this line in the main function after the video_init()...
WIILIGHT_Init();

I get this stupid error when I compile...
j:/code/poopie/source/main.cpp:124: undefined reference to `WIILIGHT_Init()'

Did I miss something obvious anybody? Was I supposed to put it in the makefile also?
You need to add it in your Makefile after this instruction:
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS	:=
Re: Wiilight help?
July 01, 2009 03:08PM
Out of curiousity, is there a way like crayons "*_wiilight_reg" way to choose how bright it is? For bosses, me and my room mate thought it would be fun to sync the boss's HP with the light on the wii. If not, then I will have to look into whatever this dude is using~
Re: Wiilight help?
July 01, 2009 03:44PM
Quote
CloneDeath
Out of curiousity, is there a way like crayons "*_wiilight_reg" way to choose how bright it is? For bosses, me and my room mate thought it would be fun to sync the boss's HP with the light on the wii. If not, then I will have to look into whatever this dude is using~
The way it's achieve in Libwiilight is by turn the light on and off with a different interval. So it looks like the light change intensity.
Re: Wiilight help?
July 01, 2009 03:47PM
Nice XD why didn't I think of that? Ok, I will look into that. thanks!

Are there any simple libraries or adresses the directly tie to the 4 leds on the bottom of the 4 wiimotes? If not, then I can live.
Sorry, only registered users may post in this forum.

Click here to login