FAQFAQ   GalleryGallery   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   Forum RSS Feed   Hacked Gadgets Main Site 

wii Nunchuk

 
Post new topic   Reply to topic    Hacked Gadgets Forum Index -> Toy Hacks
View previous topic :: View next topic  
Author Message
Turd
HG Ruler


Joined: 18 Aug 2007
Posts: 274
Location: Saskatchewan, Canada

PostPosted: Tue Mar 17, 2009 7:11 pm    Post subject: wii Nunchuk Reply with quote

Has anyone played around with a wii nunchuk controller?
Heres a video of a test program/circuit I made using a PICAXE 18X (running at 3.3v).
Code:
i2cslave $A4, i2cfast, i2cbyte

 

i2cwrite ($40,$00)

pause 10

 

lp:

writei2c (0)

pause 10



readi2c (b1,b2,b3,b4,b5,b0)



b13 = b0

b0 = b13 Xor 0x17 + 0x17



'X joy

b13 = b1

b1 = b13 Xor 0x17 + 0x17

poke $50,  b1



'Y joy

b13 = b2

b2 = b13 Xor 0x17 + 0x17

poke $51,  b2



'X acc


b13 = b3

b3 = b13 Xor 0x17 + 0x17

poke $52, b3



'Y acc


b13 = b4

b4 = b13 Xor 0x17 + 0x17

poke $54, b4



'Z acc


b13 = b5

b5 = b13 Xor 0x17 + 0x17

poke $56, b5



'buttons

poke $58, bit0

poke $59, bit1



'X joy

peek $50, b0

'Y joy

peek $51, b1

'X acc

peek $52, b2

'Y acc

peek $54, b3

'Z acc

peek $56, b4

'buttons

peek $58, b5

peek $59, b6



if b2 < 100 then

   high 0

else

   low 0

endif



if b2 > 140 then

   high 2

else

   low 2

endif



if b3 < 100 then

   high 3

else

   low 3

endif



if b3 > 140 then

   high 5

else

   low 5

endif



'pause 10

'debug

goto lp
Back to top
View user's profile Send private message Visit poster's website

Alan
Site Admin


Joined: 29 Jan 2006
Posts: 1399
Location: Winnipeg, MB

PostPosted: Fri Mar 20, 2009 3:53 am    Post subject: Reply with quote

Nice job. Seems to work very well.
Back to top
View user's profile Send private message Send e-mail
Turd
HG Ruler


Joined: 18 Aug 2007
Posts: 274
Location: Saskatchewan, Canada

PostPosted: Fri Mar 20, 2009 5:11 am    Post subject: Reply with quote

Thanks Very Happy

Heres a site with lots of info.
_________________
eric
Back to top
View user's profile Send private message Visit poster's website
Comeup
Semi Newbie


Joined: 01 Apr 2009
Posts: 8

PostPosted: Thu Apr 02, 2009 9:50 pm    Post subject: Reply with quote

lol i wish i knew wtf this stuff meant
Back to top
View user's profile Send private message
Turd
HG Ruler


Joined: 18 Aug 2007
Posts: 274
Location: Saskatchewan, Canada

PostPosted: Fri Apr 03, 2009 6:00 am    Post subject: Reply with quote

Just start by reading a bit of the manuals and go to the PICAXE forum Very Happy
_________________
eric
Back to top
View user's profile Send private message Visit poster's website
Xyon
HG Junior


Joined: 03 Aug 2009
Posts: 11

PostPosted: Mon Aug 03, 2009 9:39 am    Post subject: Reply with quote

theres an awesome mod to make it into a whiteboard
_________________
firebox voucher discount
Back to top
View user's profile Send private message
laterriere
Newbie


Joined: 19 Dec 2008
Posts: 3

PostPosted: Fri Sep 16, 2011 8:08 am    Post subject: interrested Reply with quote

How do you conect the nunchuck to the breadboard, did you make a male connector?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Hacked Gadgets Forum Index -> Toy Hacks All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group