Some help with my first homebrew wii programs February 07, 2010 06:35AM | Registered: 14 years ago Posts: 16 |
Re: Some help with my first homebrew wii programs February 07, 2010 07:24AM | Registered: 14 years ago Posts: 451 |
Re: Some help with my first homebrew wii programs February 07, 2010 09:02AM | Registered: 14 years ago Posts: 16 |
Quote
dirtrider73068
Why not use the sync buttons on the wii and wiimotes when they bring theirs over, wouldn't that be easier? After they are done and go home then resync them back to there own wii's? This post actually may belong in the coding section.
Re: Some help with my first homebrew wii programs February 09, 2010 03:49AM | Registered: 15 years ago Posts: 223 |
Quote
ekeeke
You need to permanently register the wiimotes in the System Menu, this is different from the temporary synchronization that you got by pressing 1+2. Read your Wii user manual to know how to register additional wiimotes (using the red sync buttons).
The reason is that wiimotes are shutdown when leaving the system menu and homebrew applications need to retrieve bluetooth informations to be able to automatically reconnect them. These infos are in a configuration file stored in internal memory, but (apparently) does not include wiimotes that were temporary synchronized.
Older homebrew were using temporary synchronization as well but it was painful to press 1+2 everytime you started a new app, it's easier to have them permanently registered anyway.
Re: Some help with my first homebrew wii programs February 09, 2010 10:20AM | Registered: 14 years ago Posts: 16 |
Re: Some help with my first homebrew wii programs February 09, 2010 06:07PM | Registered: 15 years ago Posts: 118 |
Re: Some help with my first homebrew wii programs February 09, 2010 06:37PM | Registered: 16 years ago Posts: 175 |
Re: Some help with my first homebrew wii programs February 10, 2010 02:46AM | Admin Registered: 16 years ago Posts: 5,132 |
Making a program to read the wiimote id's February 07, 2010 09:09AM | Registered: 14 years ago Posts: 16 |
Re: Making a program to read the wiimote id's February 07, 2010 11:28AM | Registered: 14 years ago Posts: 16 |
L:\devkitPro\wintermutes_sample>make clean clean ... L:\devkitPro\wintermutes_sample>make main.c l:/devkitPro/wintermutes_sample/source/main.c:54: error: 'byte' has not been declared make[1]: *** [main.o] Error 1 make: *** [build] Error 2
Re: Making a program to read the wiimote id's February 08, 2010 04:08PM | Registered: 15 years ago Posts: 379 |
Until you get this working I suggest you use a marker to write your name in the battery compartment. Works even when your wii is off!Quote
datalogger
When my friends come to visit and bring their wiimotes, I want to have a Homebrew app that I can start and it will show the serial number unique to each wiimote so I can write that down and know who has what remote number.
Before they leave we can check to make sure thay have the right one.
Re: Making a program to read the wiimote id's February 08, 2010 06:07PM | Registered: 15 years ago Posts: 118 |
Re: Making a program to read the wiimote id's February 08, 2010 10:29PM | Registered: 14 years ago Posts: 16 |
Quote
dancinninja
Pieces of tape work as well.
Also, "byte" needs to be declared, try:typedef unsigned char byte;
...up at the top of your file.
/** * @brief Callback that handles a read event. * * @param wm Pointer to a wiimote_t structure. * @param data Pointer to the filled data block. * @param len Length in bytes of the data block. * * This function is called automatically by the wiiuse library when * the wiimote has returned the full data requested by a previous * call to wiiuse_read_data(). * * You can read data on the wiimote, such as Mii data, if * you know the offset address and the length. * * The \a data pointer was specified on the call to wiiuse_read_data(). * At the time of this function being called, it is not safe to deallocate * this buffer. */ void handle_read(struct wiimote_t* wm, byte* data, unsigned short len) { int i = 0; printf("\n\n--- DATA READ [wiimote id %i] ---\n", wm->unid); printf("finished read of size %i\n", len); for (; i < len; ++i) { if (!(i%16)) printf("\n"); printf("%x ", data); } printf("\n\n"); }
Re: Making a program to read the wiimote id's February 09, 2010 04:01AM | Registered: 14 years ago Posts: 16 |
#ifndef __BD_ADDR_H__ #define __BD_ADDR_H__ #include#ifdef __cplusplus extern "C" { #endif /* __cplusplus */ struct bd_addr { u8 addr[6]; }; #define BD_ADDR_LEN 6 #define BD_ADDR_ANY (&(struct bd_addr){{0,0,0,0,0,0}}) #define BD_ADDR_LOCAL (&(struct bd_addr){{0,0,0,0xff,0xff,0xff}}) #define BD_ADDR(bdaddr, a, b, c, d, e, f) do{ \ (bdaddr)->addr[0] = a; \ (bdaddr)->addr[1] = b; \ (bdaddr)->addr[2] = c; \ (bdaddr)->addr[3] = d; \ (bdaddr)->addr[4] = e; \ (bdaddr)->addr[5] = f; }while(0) //TODO: USE memcmp???? #define bd_addr_cmp(addr1, addr2) (((addr1)->addr[0] == (addr2)->addr[0]) && \ ((addr1)->addr[1] == (addr2)->addr[1]) && \ ((addr1)->addr[2] == (addr2)->addr[2]) && \ ((addr1)->addr[3] == (addr2)->addr[3]) && \ ((addr1)->addr[4] == (addr2)->addr[4]) && \ ((addr1)->addr[5] == (addr2)->addr[5])) //TODO: USE memcpy???? #define bd_addr_set(addr1, addr2) do { \ (addr1)->addr[0] = (addr2)->addr[0]; \ (addr1)->addr[1] = (addr2)->addr[1]; \ (addr1)->addr[2] = (addr2)->addr[2]; \ (addr1)->addr[3] = (addr2)->addr[3]; \ (addr1)->addr[4] = (addr2)->addr[4]; \ (addr1)->addr[5] = (addr2)->addr[5]; }while(0) #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __BD_ADDR_H__ */
Re: Making a program to read the wiimote id's February 09, 2010 09:23AM | Registered: 14 years ago Posts: 16 |
struct bd_addr { u8 addr[6]; }; #define BD_ADDR_LEN 6 #define BD_ADDR_ANY (&(struct bd_addr){{0,0,0,0,0,0}}) #define BD_ADDR_LOCAL (&(struct bd_addr){{0,0,0,0xff,0xff,0xff}}) #define BD_ADDR(bdaddr, a, b, c, d, e, f) do{ \ (bdaddr)->addr[0] = a; \ (bdaddr)->addr[1] = b; \ (bdaddr)->addr[2] = c; \ (bdaddr)->addr[3] = d; \ (bdaddr)->addr[4] = e; \ (bdaddr)->addr[5] = f; }while(0)
Re: Some help with my first homebrew wii programs February 10, 2010 02:46AM | Admin Registered: 16 years ago Posts: 5,132 |
Re: Some help with my first homebrew wii programs February 10, 2010 07:12AM | Registered: 14 years ago Posts: 16 |
int main(void) { FILE *file = fopen("output.txt","wb"); struct bd_addr *BD_ADDR; BD_ADDR->addr[0] = 0xff; BD_ADDR->addr[1] = 0xff; BD_ADDR->addr[2] = 0xff; BD_ADDR->addr[3] = 0xff; BD_ADDR->addr[4] = 0xff; BD_ADDR->addr[5] = 0xff; printf_bd_addr(file,&BD_ADDR); fclose(file); return 0; } int print_bd_addr(FILE *f, const struct bd_addr *p) { return fprintf(f,"BD_ADDR = %2x:%2x:%2x:%2x:%2x:%2x", (unsigned)p->addr[0],(unsigned)p->addr[1], (unsigned)p->addr[2],(unsigned)p->addr[3], (unsigned)p->addr[4],(unsigned)p->addr[5] ); }
Re: Making a program to read the wiimote id's February 10, 2010 08:48AM | Registered: 14 years ago Posts: 16 |
Re: Some help with my first homebrew wii programs February 10, 2010 11:15PM | Admin Registered: 16 years ago Posts: 5,132 |
1)Im pretty sure that code is for a PC Wiimote libraryQuote
datalogger
Ersek said:
Re: Some help with my first homebrew wii programs February 11, 2010 08:54AM | Registered: 14 years ago Posts: 16 |