From 56792719134918c5a2d515bbaab18980cd54c71b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 9 Aug 2015 21:46:43 +0300 Subject: [PATCH] Add "Hello World" example for desktop platforms --- examples/desktop/hello-world/README.rst | 18 ++++++++++++++++ examples/desktop/hello-world/platformio.ini | 24 +++++++++++++++++++++ examples/desktop/hello-world/src/main.c | 7 ++++++ 3 files changed, 49 insertions(+) create mode 100644 examples/desktop/hello-world/README.rst create mode 100644 examples/desktop/hello-world/platformio.ini create mode 100644 examples/desktop/hello-world/src/main.c diff --git a/examples/desktop/hello-world/README.rst b/examples/desktop/hello-world/README.rst new file mode 100644 index 00000000..27f3cb49 --- /dev/null +++ b/examples/desktop/hello-world/README.rst @@ -0,0 +1,18 @@ +How to build PlatformIO based project +===================================== + +1. `Install PlatformIO `_ +2. Download `source code with examples `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-develop/examples/desktop/hello-world + + # Process example project + > platformio run + + # Clean build files + > platformio run --target clean diff --git a/examples/desktop/hello-world/platformio.ini b/examples/desktop/hello-world/platformio.ini new file mode 100644 index 00000000..9d028e13 --- /dev/null +++ b/examples/desktop/hello-world/platformio.ini @@ -0,0 +1,24 @@ +# +# 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 + +[env:native] +platform = native + +[env:win32] +platform = windows_x86 diff --git a/examples/desktop/hello-world/src/main.c b/examples/desktop/hello-world/src/main.c new file mode 100644 index 00000000..21049ca9 --- /dev/null +++ b/examples/desktop/hello-world/src/main.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + printf("Hello World from PlatformIO!\n"); + return 0; +}