mirror of
https://github.com/platformio/platformio-core.git
synced 2025-11-05 16:31:38 +01:00
Merge branch 'release/v2.9.0'
This commit is contained in:
@@ -1 +1,3 @@
|
||||
.pioenvs
|
||||
.pioenvs
|
||||
.clang_complete
|
||||
.gcc-flags.json
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
|
||||
.. Copyright 2014-present 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
|
||||
@@ -13,17 +13,26 @@ 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>`_
|
||||
2. Download `source code with examples <https://github.com/platformio/platformio-examples/archive/develop.zip>`_
|
||||
3. Extract ZIP archive
|
||||
4. Run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platformio-develop/examples/espressif/esp8266-webserver
|
||||
> cd platformio-examples/espressif/esp8266-webserver
|
||||
|
||||
# Process example project
|
||||
# Build project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Build specific environment
|
||||
> platformio run -e esp01
|
||||
|
||||
# Upload firmware for the specific environment
|
||||
> platformio run -e esp01 --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include <Arduino.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
#include <ESP8266mDNS.h>
|
||||
|
||||
|
||||
const char* ssid = "******";
|
||||
const char* password = "******";
|
||||
MDNSResponder mdns;
|
||||
@@ -33,7 +34,7 @@ void handleNotFound(){
|
||||
server.send(404, "text/plain", message);
|
||||
digitalWrite(led, 0);
|
||||
}
|
||||
|
||||
|
||||
void setup(void){
|
||||
pinMode(led, OUTPUT);
|
||||
digitalWrite(led, 0);
|
||||
@@ -51,23 +52,23 @@ void setup(void){
|
||||
Serial.println(ssid);
|
||||
Serial.print("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
|
||||
if (mdns.begin("esp8266", WiFi.localIP())) {
|
||||
Serial.println("MDNS responder started");
|
||||
}
|
||||
|
||||
|
||||
server.on("/", handleRoot);
|
||||
|
||||
|
||||
server.on("/inline", [](){
|
||||
server.send(200, "text/plain", "this works as well");
|
||||
});
|
||||
|
||||
server.onNotFound(handleNotFound);
|
||||
|
||||
|
||||
server.begin();
|
||||
Serial.println("HTTP server started");
|
||||
}
|
||||
|
||||
|
||||
void loop(void){
|
||||
server.handleClient();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user