Add src_dir option to [platformio] section of platformio.ini which allows to redefine location to project’s source directory // Resolve #83

This commit is contained in:
Ivan Kravets
2015-02-22 22:24:22 +02:00
parent e17ce83499
commit 46ae4c1a83
9 changed files with 125 additions and 23 deletions

View File

@@ -0,0 +1,22 @@
/**
* Copyright (C) Ivan Kravets <me@ikravets.com>
* See LICENSE for details.
*/
#ifndef LED_PIN
#define LED_PIN 13 // Most Arduino boards already have a LED attached to pin 13 on the board itself
#endif
void setup()
{
pinMode(LED_PIN, OUTPUT); // set pin as output
}
void loop()
{
digitalWrite(LED_PIN, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(LED_PIN, LOW); // set the LED off
delay(1000); // wait for a second
}

View File

@@ -0,0 +1,21 @@
How to buid PlatformIO based project
====================================
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
2. Download `source code with examples <https://github.com/ivankravets/platformio/archive/develop.zip>`_
3. Extract ZIP archive
4. Run these commands:
.. code-block:: bash
# Change directory to example
> cd platformio-develop/examples/arduino-own-src_dir
# Process example project
> platformio run
# Upload firmware
> platformio run --target upload
# Clean build files
> platformio run --target clean

View File

@@ -0,0 +1,26 @@
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[platformio]
src_dir = Blink
[env:arduino_uno]
platform = atmelavr
framework = arduino
board = uno