Skip to content

Commit

Permalink
Merge pull request #24 from jcamins/jce/platformio
Browse files Browse the repository at this point in the history
Add brief tutorial on configuring PlatformIO
  • Loading branch information
kxm-creare authored Oct 1, 2020
2 parents 6d48bf2 + b2d9b17 commit f2ca9d5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/vscode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Using VSCode and Platform IO with your Tympan

In addition to using the Arduino/Teensyduino IDE for working your Tympan, it is possible to use VSCode and PlatformIO as a development environment. It does, however, require some customizations to your `platformio.ini` file that might not be immediately obvious. The process for configuring VSCode and Platform IO (after you have followed the main instructions in the readme) is roughly as follows:

1. If you do not already have it, [download VSCode](https://code.visualstudio.com/download)
2. Install the [PlatformIO IDE plugin in VSCode](https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide) (note: if you use Anaconda on a Mac, you will likely need to update or reinstall Anaconda)
3. Create a new project in the PlatformIO IDE (choose the `teensy36` board)
4. Add the following three libraries to the lib_deps option: `Tympan_Library`, `https://github.com/PaulStoffregen/Audio.git`, and `https://github.com/PaulStoffregen/SD.git` (note: these are the same libraries required by the Tympan Library itself)
5. Put the path to the `libraries` directory you located in the "Installing the Tympan Library" section of the [readme](../readme.md) in the `lib_extra_dirs` option
6. Make sure to follow the instructions that PlatformIO gives you to convert your `.ino` file into a `.cpp` file (basically renaming the file and adding some additional `#include` directives)

This comment has been minimized.

Copy link
@kxm-creare

kxm-creare Oct 1, 2020

Author Contributor

@jcamins Could you tell me more about this step 6? I'm trying to run one of the sketches from the Tympan Sandbox repo and I'm missing something.

This comment has been minimized.

Copy link
@jcamins

jcamins Oct 2, 2020

Contributor

@kxm-creare all I needed to do was add the #include directives and declaring my file-scoped methods:

#include <Arduino.h>
#include <Tympan_Library.h>
#include "../../shared/ExtendedSerialManager.h"
#include "../../shared/PotentiometerServicer.h"

void applyConfiguration(void);
void activateKnob(int channel, int knob);
bool runCommand(char c);
7. Connect your Tympan to your computer and turn it on
8. Click the "Run" (right-facing arrow) button in the status bar to run your sketch on the Tympan

1 comment on commit f2ca9d5

@wheresaddie
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great. thank you

Please sign in to comment.