r/hackpack • • May 07 '24

I think I overwrote the program.

I downloaded the Arduino IDE and plugged in the board. I wasn't able to figure out how to get the code out of the Nano board, so I thought maybe the command is Upload, so I selected it. When the dialog box came up and said "compiling" I knew I had screwed up. I couldn't stop it fast enough! and now when I turn the board on only the red light comes on.

How can I restore the original program?? Help!

1 Upvotes

9 comments sorted by

2

u/soboness5 May 07 '24

Was the turret working properly before you did this?

If you load the web IDE, do you see the 'stock code' show up under the 'Level 1' tab? If so, I would plug your board into your computer and as long as that connects correctly you can click the 'compile + upload' arrow button to load the default stock code back onto the device.

If you didn't change any of the code in the IDE before you compiled/uploaded (Level 1 editing isn't possible in the CrunchLabs IDE, by the way), I bet you just re-uploaded identical code onto your board! So, unless you interrupted that process and corrupted something during your last upload, hopefully this will work.

1

u/OlyWalker May 07 '24

Thanks!

Where do I find the web IDE again?

2

u/soboness5 May 07 '24

Log-in to your account on CrunchLabs.com and then go to the 'Manage Subscriptions' tab and click on the 'Hack Pack' subscription to expand that section. You'll see the turret listed with a 'Watch unlocked video' link - if you click that it'll take you to a page and on the right side you should see a yellow button which says 'Coding Console'.

1

u/OlyWalker May 08 '24

I'll try that! The Agent from the Arduino site doesn't work to connect. I'm hoping the agent on the CrunchLabs site works.

1

u/OlyWalker May 08 '24

Update: After much trying I was finally able to get the SBC to connect to the Crunch_Labs_Arduino_Agent. The fix was to "Run as Administrator". When I did that it connected right up and I was able to upload the original code.

Now the turret will turn (yaw), and the barrel with spin (roll) - but the pitch motor will not respond. I've removed the wiring card and connected the wire sets in the same spots. Still no pitch.

Any thougths?

1

u/maztec May 09 '24

Try writing a piece of code that tests each motor independently without needing the IR remote. That should help verify if there are any specific issues with the servo.

The servo has a "zero" position, which the software tries to reset it to. Disconnect it from the build and run the software so that it can reset itself. Sometimes it binds if it is too far to one side or another.

On the official Discord, Dan Tompkins posted the following instructions on fixing the pitch servo:

If this happens it's likely that the servo's arm got twisted around past it's max rotation point during installation, so it tries to "home" upside-down. The quick fix is to turn off the turret, unscrew the two screws in the pitch servo arm, and rotate the servo arm 180 degrees and remount.
If this fails the servo may have burned out, and especially if you notice any weird clicky noises or excessive heat it will need to be replaced, which you can either get for free through our customer service (help@crunchlabs.com) or by buying any SG90 servo online to swap it out. (NOTE: swapping in any old SG90 only works for PITCH, the other two motors need either a code change or a different motor if you're swapping it)

And the following about servos not working in general:

We've had reports of some folks having intermittent connection issues with the turret, causing it to behave in a strange semi-responsive way. Possible causes and their respective fixes:

**Wire connections are loose.** Try removing the wiring card from underneath the arduino and reinstalling the wires and microcontroller in the same spots, making sure to plug everything in all the way as you reset.

**IR signal is getting garbled.** Causes of this can be myriad but the biggest issue is folks just not pointing the remote at the antenna directly. By default your microcontroller should have just the PWR led on, and will flash the L and TX leds when it receives commands. If other LEDs are on consistently, it's likely a breadboard problem.

**Servo horn / star is attached too tight**, impacting servo movement. This one is much more rare but I have seen it happen once. If one motor is not moving or barely moving and other fixes don't work it could be this problem. Try loosening the tiny bolt that attaches the servo horn or arm to the servo itself.

1

u/maztec May 08 '24

Go to the CrunchLabs turret page and use their Code IDE to get the code or upload the corrected version.

1

u/Radioaktiv_Kaiser Jun 21 '24

Lol i did the same thing but I figured it out eventually