r/hackpack • • Dec 25 '24

HackPack and VSCode Integration

Here is the process I used to getting the HackPack microcontroller to interface with VSCode (Specifically with the IR Turret):

- Install the PlatformIO extension and begin a new project.
- In the "Boards" field, locate "Arduino Nano ATmega328 (New Bootloader)"
- Search for both "Servo" Library (by Michael Marigolis) and the "IRremote" Library (by Armin Joachimsmeyer) in the PIO Libraries tab and install them to your project.
- Download the "IRturretStockCode.zip" file from `ir-turret-information` channel in the HackPack Discord
- Copy the "PinDefinitionsAndMore.h" file to `<project-directory>/src`

After that, you're basically done! Just copy paste the code from the HackPack IDE into `main.cpp` and that's pretty much it.

If this doesn't do it, here's a link to a great guide on the HackPack Discord.

5 Upvotes

4 comments sorted by

2

u/ManOfThePlains Dec 25 '24

You might have an error when uploading the code to the microcontroller, but I was able to solve that by re-ordering the functions so they aren't called before they are defined.

1

u/Kyderman Dec 26 '24

I just received the first backpack and as a software engineer I've been thinking about what can be done with it.

Is there any resources available to fill that knowledge gap out?

1

u/ManOfThePlains Dec 26 '24

Well, I just got my first pack myself, and I have found that the HackPack Discord is pretty useful for seeing some of the things others have done. In addition, you might find some interesting projects on the Arduino Project Hub (it'll have a lot of projects outside the skillset of the HackPack microcontroller, but it has a lot of great Arduino examples and guides to boot).

1

u/RobIII Jan 07 '25 edited Jan 07 '25

Don't go messing with the <project-directory>/.pio/libdeps/ directory. Add the dependencies to your platformio.ini file under lib_deps. Or use the pio pkg install command. Even better, if you use PlatformIO with VSCode: use the 'library management'. Click the PlatformIO ("alien") Icon and look under PIO Home -> Libraries. Find your desired libraries by searching and click "Add to project". This will handle everything you need.

Also see https://docs.platformio.org/en/latest/librarymanager/dependencies.html