| 
									
										
										
										
											2015-11-18 17:33:46 +02:00
										 |  |  | ..  Copyright 2014-2015 Ivan Kravets <me@ikravets.com>
 | 
					
						
							|  |  |  |     Licensed under the Apache License, Version 2.0 (the "License");
 | 
					
						
							|  |  |  |     you may not use this file except in compliance with the License.
 | 
					
						
							|  |  |  |     You may obtain a copy of the License at
 | 
					
						
							|  |  |  |        http://www.apache.org/licenses/LICENSE-2.0
 | 
					
						
							|  |  |  |     Unless required by applicable law or agreed to in writing, software
 | 
					
						
							|  |  |  |     distributed under the License is distributed on an "AS IS" BASIS,
 | 
					
						
							|  |  |  |     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
					
						
							|  |  |  |     See the License for the specific language governing permissions and
 | 
					
						
							|  |  |  |     limitations under the License.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-09 16:31:20 +03:00
										 |  |  | .. _quickstart:
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-02 17:18:32 +02:00
										 |  |  | Quickstart
 | 
					
						
							| 
									
										
										
										
											2014-08-09 16:31:20 +03:00
										 |  |  | ==========
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-12-26 01:02:44 +02:00
										 |  |  | .. hint::
 | 
					
						
							| 
									
										
										
										
											2014-12-30 23:22:42 +02:00
										 |  |  |     Please read `Get Started <http://platformio.org/#!/get-started>`_
 | 
					
						
							| 
									
										
										
										
											2014-11-07 22:14:44 +02:00
										 |  |  |     article from the official WebSite.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-29 20:22:01 +02:00
										 |  |  | 1. :ref:`Install PlatformIO <installation>`.
 | 
					
						
							| 
									
										
										
										
											2014-08-09 16:31:20 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 21:05:38 +03:00
										 |  |  | 2. Find board ``type`` using `Embedded Boards Explorer <http://platformio.org/#!/boards>`_
 | 
					
						
							|  |  |  |    or via :ref:`cmd_boards` command.
 | 
					
						
							| 
									
										
										
										
											2014-08-09 16:31:20 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-08 20:12:42 +02:00
										 |  |  | 3. Initialize new PlatformIO based project via :ref:`cmd_init` command with the
 | 
					
						
							|  |  |  |    pre-configured environments for your boards:
 | 
					
						
							| 
									
										
										
										
											2014-08-09 16:31:20 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | .. code-block:: bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-02 15:19:44 +02:00
										 |  |  |     $ platformio init --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
 | 
					
						
							| 
									
										
										
										
											2014-08-09 16:31:20 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-03 14:56:24 +02:00
										 |  |  |     The current working directory *** will be used for the new project.
 | 
					
						
							|  |  |  |     You can specify another project directory via
 | 
					
						
							|  |  |  |     `platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     The next files/directories will be created in ***
 | 
					
						
							| 
									
										
										
										
											2015-01-31 22:42:52 +02:00
										 |  |  |     platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-|
 | 
					
						
							| 
									
										
										
										
											2015-10-13 14:01:16 +01:00
										 |  |  |     src - Put your source files here
 | 
					
						
							| 
									
										
										
										
											2015-08-21 23:56:22 +03:00
										 |  |  |     lib - Put here project specific (private) libraries
 | 
					
						
							| 
									
										
										
										
											2014-12-03 14:56:24 +02:00
										 |  |  |     Do you want to continue? [y/N]: y
 | 
					
						
							|  |  |  |     Project has been successfully initialized!
 | 
					
						
							| 
									
										
										
										
											2015-01-31 22:42:52 +02:00
										 |  |  |     Useful commands:
 | 
					
						
							|  |  |  |     `platformio run` - process/build project from the current directory
 | 
					
						
							|  |  |  |     `platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board
 | 
					
						
							|  |  |  |     `platformio run --target clean` - clean project (remove compiled files)
 | 
					
						
							| 
									
										
										
										
											2014-08-09 16:31:20 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-10-13 14:01:16 +01:00
										 |  |  | Put your source files ``*.h, *.c, *.cpp or *.ino`` to ``src`` directory.
 | 
					
						
							| 
									
										
										
										
											2014-08-11 12:20:08 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-29 20:22:01 +02:00
										 |  |  | 4. Process the project's environments.
 | 
					
						
							| 
									
										
										
										
											2014-08-09 16:31:20 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-08 20:12:42 +02:00
										 |  |  | Change working directory to the project's root where is located
 | 
					
						
							|  |  |  | :ref:`Project Configuration File (platformio.ini) <projectconf>` and run:
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-09 16:31:20 +03:00
										 |  |  | .. code-block:: bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     $ platformio run
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-29 20:22:01 +02:00
										 |  |  |     # if you don't have specified `targets = upload` option for environment,
 | 
					
						
							|  |  |  |     # then you can upload firmware manually with this command:
 | 
					
						
							| 
									
										
										
										
											2014-08-09 16:31:20 +03:00
										 |  |  |     $ platformio run --target upload
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # clean project
 | 
					
						
							|  |  |  |     $ platformio run --target clean
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-12-16 00:35:24 +02:00
										 |  |  | Useful links:
 | 
					
						
							| 
									
										
										
										
											2014-08-12 19:29:57 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-12-16 00:35:24 +02:00
										 |  |  | * `Project examples <https://github.com/platformio/platformio/tree/develop/examples>`_
 | 
					
						
							|  |  |  | * :ref:`userguide` for PlatformIO commands
 | 
					
						
							|  |  |  | * `Quickstart for Espressif ESP8266 <https://github.com/esp8266/Arduino/blob/master/doc/platformio.md>`_
 |