Skip to content

Commit ec73b41

Browse files
authored
Merge pull request #2 from witnessmenow/master
Merge from source
2 parents 54ff625 + d208102 commit ec73b41

File tree

8 files changed

+98
-2
lines changed

8 files changed

+98
-2
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@
2626
*.exe
2727
*.out
2828
*.app
29+
.pioenvs
30+
.piolibdeps
31+
.clang_complete
32+
.gcc-flags.json

.travis.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
language: python
2+
python:
3+
- "2.7"
4+
5+
# Cache PlatformIO packages using Travis CI container-based infrastructure
6+
sudo: false
7+
cache:
8+
directories:
9+
- "~/.platformio"
10+
11+
env:
12+
- SCRIPT=platformioSingle EXAMPLE=EchoBot BOARDTYPE=ESP8266 BOARD=d1_mini
13+
- SCRIPT=platformioSingle EXAMPLE=CustomKeyboard BOARDTYPE=ESP8266 BOARD=d1_mini
14+
- SCRIPT=platformioSingle EXAMPLE=FlashledBot BOARDTYPE=ESP8266 BOARD=d1_mini
15+
- SCRIPT=platformioSingle EXAMPLE=UsingWiFiManager BOARDTYPE=ESP8266 BOARD=d1_mini
16+
- SCRIPT=platformioSingle EXAMPLE=BulkMessages BOARDTYPE=ESP8266 BOARD=d1_mini
17+
18+
# This will run all the ESP8266 examples
19+
#- SCRIPT=platformioEsp8266 BOARD=d1_mini
20+
21+
install:
22+
- pip install -U platformio
23+
#
24+
# Libraries from PlatformIO Library Registry:
25+
#
26+
# http://platformio.org/lib/show/64/ArduinoJson
27+
- platformio lib -g install 64
28+
# http://platformio.org/lib/show/567/WifiManager
29+
- platformio lib -g install 567
30+
script: scripts/travis/$SCRIPT.sh

examples/101/FlashledBot/FlashledBot.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void handleNewMessages(int numNewMessages) {
5454
}
5555
}
5656
if (text == "/start") {
57-
String from_name = message.from_name;
57+
String from_name = bot.messages[i].from_name;
5858
if (from_name == "") from_name = "Anonymous";
5959

6060
String welcome = "Welcome, " + from_name + ", from FlashLedBot, your personal Bot on Arduino 101\n";

examples/ESP8266/FlashledBot/FlashledBot.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void handleNewMessages(int numNewMessages) {
5454
}
5555
}
5656
if (text == "/start") {
57-
String from_name = message.from_name;
57+
String from_name = bot.messages[i].from_name;
5858
if (from_name == "") from_name = "Anonymous";
5959

6060
String welcome = "Welcome, " + from_name + ", from FlashLedBot, your personal Bot on ESP8266\n";

lib/readme.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
This directory is intended for the project specific (private) libraries.
3+
PlatformIO will compile them to static libraries and link to executable file.
4+
5+
The source code of each library should be placed in separate directory, like
6+
"lib/private_lib/[here are source files]".
7+
8+
For example, see how can be organized `Foo` and `Bar` libraries:
9+
10+
|--lib
11+
| |--Bar
12+
| | |--docs
13+
| | |--examples
14+
| | |--src
15+
| | |- Bar.c
16+
| | |- Bar.h
17+
| |--Foo
18+
| | |- Foo.c
19+
| | |- Foo.h
20+
| |- readme.txt --> THIS FILE
21+
|- platformio.ini
22+
|--src
23+
|- main.c
24+
25+
Then in `src/main.c` you should use:
26+
27+
#include <Foo.h>
28+
#include <Bar.h>
29+
30+
// rest H/C/CPP code
31+
32+
PlatformIO will find your libraries automatically, configure preprocessor's
33+
include paths and build them.
34+
35+
More information about PlatformIO Library Dependency Finder
36+
- http://docs.platformio.org/page/librarymanager/ldf.html

platformio.ini

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; PlatformIO Project Configuration File
2+
;
3+
; Build options: build flags, source filter
4+
; Upload options: custom upload port, speed and extra flags
5+
; Library options: dependencies, extra library storages
6+
; Advanced options: extra scripting
7+
;
8+
; Please visit documentation for the other options and examples
9+
; http://docs.platformio.org/page/projectconf.html
10+
[common]
11+
lib_deps_external = ArduinoJson
12+
13+
[env:d1_mini]
14+
platform = espressif8266
15+
board = d1_mini
16+
framework = arduino
17+
lib_deps = WifiManager, ${common.lib_deps_external}

scripts/travis/platformioEsp8266.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh -eux
2+
3+
for EXAMPLE in $PWD/examples/ESP8266/*/*.ino;
4+
do
5+
platformio ci $EXAMPLE -l '.' -b $BOARD
6+
done

scripts/travis/platformioSingle.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh -eux
2+
3+
platformio ci $PWD/examples/$BOARDTYPE/$EXAMPLE/$EXAMPLE.ino -l '.' -b $BOARD

0 commit comments

Comments
 (0)