mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 18:17:13 +02:00
Add "Hello World" example for desktop platforms
This commit is contained in:
18
examples/desktop/hello-world/README.rst
Normal file
18
examples/desktop/hello-world/README.rst
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
How to build PlatformIO based project
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
|
||||||
|
2. Download `source code with examples <https://github.com/platformio/platformio/archive/develop.zip>`_
|
||||||
|
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
|
24
examples/desktop/hello-world/platformio.ini
Normal file
24
examples/desktop/hello-world/platformio.ini
Normal file
@ -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
|
7
examples/desktop/hello-world/src/main.c
Normal file
7
examples/desktop/hello-world/src/main.c
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
printf("Hello World from PlatformIO!\n");
|
||||||
|
return 0;
|
||||||
|
}
|
Reference in New Issue
Block a user