From 0fb6dce050cadf016c55003078ae7ccde346c81a Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Fri, 27 Apr 2018 07:54:33 -0700 Subject: [PATCH] pio: start platformIO projects --- README.rst | 1 + pio/nrf52/test01/.gitignore | 5 +++ pio/nrf52/test01/.vscode/extensions.json | 7 ++++ pio/nrf52/test01/.vscode/settings.json | 6 ++++ pio/nrf52/test01/lib/readme.txt | 41 ++++++++++++++++++++++++ pio/nrf52/test01/platformio.ini | 15 +++++++++ pio/nrf52/test01/src/main.cpp | 12 +++++++ 7 files changed, 87 insertions(+) create mode 100644 pio/nrf52/test01/.gitignore create mode 100644 pio/nrf52/test01/.vscode/extensions.json create mode 100644 pio/nrf52/test01/.vscode/settings.json create mode 100644 pio/nrf52/test01/lib/readme.txt create mode 100644 pio/nrf52/test01/platformio.ini create mode 100644 pio/nrf52/test01/src/main.cpp diff --git a/README.rst b/README.rst index ebc89ce..87c6a3d 100644 --- a/README.rst +++ b/README.rst @@ -14,5 +14,6 @@ Projects `the basement `_ + ``ods/``: `Open Data Structures `_ + ``par/``: `A Pamphlet Against R `_ ++ ``pio/``: `PlatformIO `_ projects + ``practical_prolog/``: `The Practice of Prolog `_ + ``uc/``: `Understanding Computation `_ diff --git a/pio/nrf52/test01/.gitignore b/pio/nrf52/test01/.gitignore new file mode 100644 index 0000000..6a01030 --- /dev/null +++ b/pio/nrf52/test01/.gitignore @@ -0,0 +1,5 @@ +.pioenvs +.piolibdeps +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json diff --git a/pio/nrf52/test01/.vscode/extensions.json b/pio/nrf52/test01/.vscode/extensions.json new file mode 100644 index 0000000..8281e64 --- /dev/null +++ b/pio/nrf52/test01/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ] +} \ No newline at end of file diff --git a/pio/nrf52/test01/.vscode/settings.json b/pio/nrf52/test01/.vscode/settings.json new file mode 100644 index 0000000..091a2a0 --- /dev/null +++ b/pio/nrf52/test01/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "terminal.integrated.env.linux": { + "PATH": "/home/kyle/.platformio/penv/bin:/home/kyle/.platformio/penv:/home/kyle/.cargo/bin:/home/kyle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/kyle/go/bin", + "PLATFORMIO_CALLER": "vscode" + } +} \ No newline at end of file diff --git a/pio/nrf52/test01/lib/readme.txt b/pio/nrf52/test01/lib/readme.txt new file mode 100644 index 0000000..131f1bf --- /dev/null +++ b/pio/nrf52/test01/lib/readme.txt @@ -0,0 +1,41 @@ + +This directory is intended for the project specific (private) libraries. +PlatformIO will compile them to static libraries and link to executable file. + +The source code of each library should be placed in separate directory, like +"lib/private_lib/[here are source files]". + +For example, see how can be organized `Foo` and `Bar` libraries: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) http://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- readme.txt --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +Then in `src/main.c` you should use: + +#include +#include + +// rest H/C/CPP code + +PlatformIO will find your libraries automatically, configure preprocessor's +include paths and build them. + +More information about PlatformIO Library Dependency Finder +- http://docs.platformio.org/page/librarymanager/ldf.html diff --git a/pio/nrf52/test01/platformio.ini b/pio/nrf52/test01/platformio.ini new file mode 100644 index 0000000..0669626 --- /dev/null +++ b/pio/nrf52/test01/platformio.ini @@ -0,0 +1,15 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; http://docs.platformio.org/page/projectconf.html + +[env:nrf52_dk] +platform = nordicnrf52 +board = nrf52_dk +framework = arduino +; upload_protocol = nrf \ No newline at end of file diff --git a/pio/nrf52/test01/src/main.cpp b/pio/nrf52/test01/src/main.cpp new file mode 100644 index 0000000..51ab96f --- /dev/null +++ b/pio/nrf52/test01/src/main.cpp @@ -0,0 +1,12 @@ +#include + +const int ledPin = 17; + +void setup() { + pinMode(ledPin, OUTPUT); + digitalWrite(ledPin, HIGH); +} + +void loop() { + // put your main code here, to run repeatedly: +} \ No newline at end of file