pio: start platformIO projects

This commit is contained in:
Kyle Isom 2018-04-27 07:54:33 -07:00
parent c98ca59a5e
commit 0fb6dce050
7 changed files with 87 additions and 0 deletions

View File

@ -14,5 +14,6 @@ Projects
`the basement <https://github.com/kisom/the_basement>`_
+ ``ods/``: `Open Data Structures <http://opendatastructures.org>`_
+ ``par/``: `A Pamphlet Against R <https://panicz.github.io/pamphlet/>`_
+ ``pio/``: `PlatformIO <https://platformio.org/>`_ projects
+ ``practical_prolog/``: `The Practice of Prolog <https://mitpress.mit.edu/books/practice-prolog>`_
+ ``uc/``: `Understanding Computation <http://computationbook.com/>`_

5
pio/nrf52/test01/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
.pioenvs
.piolibdeps
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json

View File

@ -0,0 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}

View File

@ -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"
}
}

View File

@ -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 <Foo.h>
#include <Bar.h>
// 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

View File

@ -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

View File

@ -0,0 +1,12 @@
#include <Arduino.h>
const int ledPin = 17;
void setup() {
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
}