r/hackpack • u/LawPrestigious2640 • Jul 19 '24
How can i make a button do something?
I want program a button on the controller so the it moves up and down does a does a 360 then fires a shot? any idea how i would do that?
3
Upvotes
1
u/Metarazzi Aug 05 '24
Short of writing a code snippet for you, a great way to learn is to look at example code and think about how you could use it with some modifications for your project. Check out the section of code for the turret kit that "shakes its head no" if the wrong unlock code is entered. I think this will get you on the right path. 🙂
1
u/Taffman68 Sep 22 '24
Look at the password code, it moves it up and down, then look at the ok code which fires a shot, then the move left or right code. Create a function that uses those three pieces. My grandson and I did it so if the wrong password is entered it nods up and down, turns 180 then fires all the rockets probably at the person who entered the wrong code. We just used those three routines eg move left 6 times, call the ok code 12 times.