Hello All,
I thought that I would announce a library which I have ported to work with the Adafruit Trinket. I ported the Wii Nunchuck Library to work with the Trinket, and all of the functions except for the debug-over-serial work without any issues. I have removed any functions which do not work in the library to eliminate any confusions. Also, I have completed the code which was originally posted at the Arduino Forums to support syntax highlighting in the Arduino IDE and have included a demo sketch along with the library to make sure your controller is working. The hookup instructions are different, so I have also included those at the top of the demo sketch.
You can download it from my Github, located at: http://www.github.com/PyroAVR/TrinketNunchuck
Note that it requires TinyWireM to be installed in your Arduino library path as well.
I hope that someone can make use of this!
New Trinket Library!
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: New Trinket Library!
Nice! Thank you.
- frank26080115
- Posts: 126
- Joined: Fri Jun 15, 2007 1:04 am
Re: New Trinket Library!
cool stuff
If you restructure your code a bit, you can also work with the Wiimote Classic Controller. You can also read back data from the Wiimote's infrared camera
TWI is a synchronous bus, I think you might benefit from using a software bit bang implementation of TWI instead of one that uses the USI, this will free up the USI to do other things. Just food for thought. Go to Atmel's site and search for "Atmel AVR156: TWI Master Bit Bang Driver" to learn more.
I might end up writing a TinyWireM replacement using AVR156 but it's not high on my priorities list
If you restructure your code a bit, you can also work with the Wiimote Classic Controller. You can also read back data from the Wiimote's infrared camera
TWI is a synchronous bus, I think you might benefit from using a software bit bang implementation of TWI instead of one that uses the USI, this will free up the USI to do other things. Just food for thought. Go to Atmel's site and search for "Atmel AVR156: TWI Master Bit Bang Driver" to learn more.
I might end up writing a TinyWireM replacement using AVR156 but it's not high on my priorities list
- DisruptItYourself
- Posts: 193
- Joined: Mon Sep 23, 2013 6:58 pm
Re: New Trinket Library!
Hey we should brainstorm and work together on a project. I would love to use a classic controller over usb!
- frank26080115
- Posts: 126
- Joined: Fri Jun 15, 2007 1:04 am
Re: New Trinket Library!
I've already done that, also done that with PS2 controllers, stuff like that takes me 30 minutes now. I can probably turn my old code into Trinket friendly code... not high on my priorities list though.indiwerwlf wrote:Hey we should brainstorm and work together on a project. I would love to use a classic controller over usb!
Meanwhile, check out http://wiibrew.org/wiki/Wiimote/Extensi ... Controller for data format and identifier information
- DisruptItYourself
- Posts: 193
- Joined: Mon Sep 23, 2013 6:58 pm
Re: New Trinket Library!
But think how cool it would be to cut the classic controllers cable, wire everything up with a trinket inside the classic controller and leave the mini USB poking out. Is there enough room in there for an arduino mico at least? Then I wouldn't really have to do much to the code...
- frank26080115
- Posts: 126
- Joined: Fri Jun 15, 2007 1:04 am
Re: New Trinket Library!
Trinket 3.3 is probably the best choice in terms of size, the next smallest option is probably Teensy (but make sure you install the 3.3V mod for it)indiwerwlf wrote:But think how cool it would be to cut the classic controllers cable, wire everything up with a trinket inside the classic controller and leave the mini USB poking out. Is there enough room in there for an arduino mico at least? Then I wouldn't really have to do much to the code...
Arduino Micro is the same chip as the Teensy but almost twice as large
-
- Posts: 27
- Joined: Sun Sep 02, 2012 6:11 pm
Re: New Trinket Library!
I'm working on that one, hold on!indiwerwlf wrote:Hey we should brainstorm and work together on a project. I would love to use a classic controller over usb!
-
- Posts: 27
- Joined: Sun Sep 02, 2012 6:11 pm
Re: New Trinket Library!
That too, for that matter...indiwerwlf wrote:But think how cool it would be to cut the classic controllers cable, wire everything up with a trinket inside the classic controller and leave the mini USB poking out. Is there enough room in there for an arduino mico at least? Then I wouldn't really have to do much to the code...
-
- Posts: 27
- Joined: Sun Sep 02, 2012 6:11 pm
Re: New Trinket Library!
I'm still learning how to bit-bang serial buses. When I figure it out, I'll definitely give that a shot. Right now I'm making an FPV helmet with the BBB and reading data from the WiiMote would make an interesting control scheme. I'll port it back to Trinket when I finish, perhaps...frank26080115 wrote:cool stuff
If you restructure your code a bit, you can also work with the Wiimote Classic Controller. You can also read back data from the Wiimote's infrared camera
TWI is a synchronous bus, I think you might benefit from using a software bit bang implementation of TWI instead of one that uses the USI, this will free up the USI to do other things. Just food for thought. Go to Atmel's site and search for "Atmel AVR156: TWI Master Bit Bang Driver" to learn more.
I might end up writing a TinyWireM replacement using AVR156 but it's not high on my priorities list
Please be positive and constructive with your questions and comments.