mirror of
https://github.com/kou029w/k2ping.git
synced 2025-01-18 16:07:59 +00:00
commit
4b6467da9c
4 changed files with 84 additions and 65 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
.pioenvs
|
||||
.piolibdeps
|
||||
.pioenvs
|
||||
.piolibdeps
|
||||
|
|
29
.travis.yml
29
.travis.yml
|
@ -1,14 +1,15 @@
|
|||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
|
||||
sudo: false
|
||||
cache:
|
||||
directories:
|
||||
- "~/.platformio"
|
||||
|
||||
install:
|
||||
- pip install -U platformio
|
||||
|
||||
script:
|
||||
- platformio run
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
|
||||
sudo: false
|
||||
cache:
|
||||
directories:
|
||||
- "~/.platformio"
|
||||
|
||||
install:
|
||||
- pip install -U platformio
|
||||
- platformio lib install 1526
|
||||
|
||||
script:
|
||||
- platformio run
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
|
||||
This directory is intended for the project specific (private) libraries.
|
||||
PlatformIO will compile them to static libraries and link to executable file.
|
||||
|
||||
The source code of each library should be placed in separate directory, like
|
||||
"lib/private_lib/[here are source files]".
|
||||
|
||||
For example, see how can be organized `Foo` and `Bar` libraries:
|
||||
|
||||
|--lib
|
||||
| |--Bar
|
||||
| | |--docs
|
||||
| | |--examples
|
||||
| | |--src
|
||||
| | |- Bar.c
|
||||
| | |- Bar.h
|
||||
| |--Foo
|
||||
| | |- Foo.c
|
||||
| | |- Foo.h
|
||||
| |- readme.txt --> THIS FILE
|
||||
|- platformio.ini
|
||||
|--src
|
||||
|- main.c
|
||||
|
||||
Then in `src/main.c` you should use:
|
||||
|
||||
#include <Foo.h>
|
||||
#include <Bar.h>
|
||||
|
||||
// rest H/C/CPP code
|
||||
|
||||
PlatformIO will find your libraries automatically, configure preprocessor's
|
||||
include paths and build them.
|
||||
|
||||
More information about PlatformIO Library Dependency Finder
|
||||
- http://docs.platformio.org/page/librarymanager/ldf.html
|
||||
|
||||
This directory is intended for the project specific (private) libraries.
|
||||
PlatformIO will compile them to static libraries and link to executable file.
|
||||
|
||||
The source code of each library should be placed in separate directory, like
|
||||
"lib/private_lib/[here are source files]".
|
||||
|
||||
For example, see how can be organized `Foo` and `Bar` libraries:
|
||||
|
||||
|--lib
|
||||
| |--Bar
|
||||
| | |--docs
|
||||
| | |--examples
|
||||
| | |--src
|
||||
| | |- Bar.c
|
||||
| | |- Bar.h
|
||||
| |--Foo
|
||||
| | |- Foo.c
|
||||
| | |- Foo.h
|
||||
| |- readme.txt --> THIS FILE
|
||||
|- platformio.ini
|
||||
|--src
|
||||
|- main.c
|
||||
|
||||
Then in `src/main.c` you should use:
|
||||
|
||||
#include <Foo.h>
|
||||
#include <Bar.h>
|
||||
|
||||
// rest H/C/CPP code
|
||||
|
||||
PlatformIO will find your libraries automatically, configure preprocessor's
|
||||
include paths and build them.
|
||||
|
||||
More information about PlatformIO Library Dependency Finder
|
||||
- http://docs.platformio.org/page/librarymanager/ldf.html
|
||||
|
|
|
@ -1,20 +1,38 @@
|
|||
#include <ESP8266WiFi.h>
|
||||
#include <Wire.h>
|
||||
#include <LiquidCrystal.h>
|
||||
|
||||
// Model: WeMos D1
|
||||
#define D0 3
|
||||
#define D1 1
|
||||
#define D2 16
|
||||
#define D3 5
|
||||
#define D4 4
|
||||
#define D5 14
|
||||
#define D6 12
|
||||
#define D7 13
|
||||
#define D8 0
|
||||
#define D9 2
|
||||
#define D10 15
|
||||
// Digital pins for WeMos D1
|
||||
static const uint8_t D[] = {3, 1, 16, 5, 4, 14, 12, 13, 0, 2, 15};
|
||||
|
||||
// LCD Keypad Shield for Arduino
|
||||
LiquidCrystal lcd(D[8], D[9], D[4], D[5], D[6], D[7]);
|
||||
|
||||
void setup() {
|
||||
;
|
||||
lcd.begin(16, 2);
|
||||
|
||||
WiFi.begin("network-name", "pass-to-network");
|
||||
|
||||
lcd.print("Connecting");
|
||||
lcd.setCursor(0, 1);
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(500);
|
||||
|
||||
static uint8_t i = 0;
|
||||
lcd.setCursor((i %= 32) % 16, 1);
|
||||
if (i < 16) {
|
||||
lcd.write(0xFF);
|
||||
i++;
|
||||
} else if (i < 32) {
|
||||
lcd.print(" ");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
lcd.clear();
|
||||
lcd.print("Connected");
|
||||
lcd.setCursor(0, 1);
|
||||
lcd.print(WiFi.localIP());
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
|
Loading…
Add table
Reference in a new issue