Looking for some advice and programming help.
I am designing a Portal Gun from Rick and Morty for an upcoming convention. I found an STL file (that I am taking some design liberties with) and now I am trying to assemble some electronics for it. (I did attach an image of the original “recipe” I found for the electronics.) My design edit is a WIP and I still need to remove the standoffs and a few other things so please be kind.
I am somewhat familiar with the Proffieboard since I have one in a pixel saber and thought it would be a good fit for the features that I want that I do not believe the Adafruit Trinket is capable of.
So here is the list of things I want to do in this build. Please take a look and let me know if this is something that is possible with the Proffie or if my expectations are too high.
Replace the Trinket with the Proffieboard v2.2 and power it with a removable 18650 or something comparable that has a smaller footprint.
Keep the alphanumeric display and use the rotary encoder for just that specifically.
Add a speaker for SFX
Replace the three green front leds with an addressable pixel strip for more effects and colors.
Replace the green led in the lid with a single addressable pixel (essentially making it a crystal chamber)
Add two momentary switches on the underside of the handle. One for power and the other for SFX.
There is also a good bit of code that the original designer had for the Trinket to use with the display and rotary encoder. I would like to still be able to use it but I am not really a programmer and I do not know what, if anything, needs to be changed to get it to work with the Proffie. (The link for that is GitHub - pomeroyb/PortalGun: Code to control a Portal Gun (From Rick and Morty) and a video demo here Portal Gun Demonstration - YouTube)
Thanks in advance for any help and sorry about the collage, I was only allowed to add one photo.
This screenshot is annoying, because I can’ follow (or read) the links can we replace it with a link to something helpful, or actual text?
Sorry about that, here is the link to the STL file page you’ll have to scroll down a bit to reach the links to the components. Portal Gun by Intentional3D - Thingiverse
Ok, so the good news is that ProffieOS has support for rotary encoders already.
The display is not supported but you can probably use an existing library to access it IF you use a secondary i2c bus available on the Proffieboard. The primary i2c bus is already used with APIs which are not compatible with most libraries. Using the primary i2c is possible, but more work.
Using the existing code is probably not possible, because it’s almost certainly not compatible with playing sounds and driving neopixels at the same time. However, parts of it could probably be taken and re-used.
Basically, I think a Proffieboard can do all of the things you want, but it will require a fair amount of work to make it all work together. Doing it with a trinket is definitely a lot less work, but maybe also less fun. If you’re on a time limit, it might be best to use a trinket.
@profezzorn Thanks a bunch for the info! So if I wanted to take the hard/ fun way, what would I need to do programming wise to get the rotary encoder to control the display?
So most of the code for the rotary support exists here:
You might be able to just use the ChangePresetRotaryReceiver, which would make the rotary button change preset, and then you don’t need to do any coding to make the rotary button work.
If you want to make the rotary button do something else, you may have to code a different receiver, but that is fairly simple.
Making the display work is a little harder. You would want to code something that checks what the current preset and power state is and updates the display accordingly.
Probably the easiest way would be to get a V3 Proffieboard, then initialize the adafruit ledbackpack library with Wire3, which comes out through the Free2/Free3 pads on the V3 proffieboard. Then all you should need to do is to write some code that inherits from SaberBase, reacts to events and updates the display accordingly. Might be easiest to just put that stuff in the prop file, especially since there is a fair amount of examples for how to create prop files already.
@ShadowStorm013 I’m interested in making an Alien’s M41 prop, and that would require support of the LCD display, too. If you start with this, please PM me.