From 438756b0f3383ef22d865577783a426290b732b2 Mon Sep 17 00:00:00 2001 From: kou029w Date: Sat, 15 Apr 2017 13:06:48 +0900 Subject: [PATCH] =?UTF-8?q?LCD=E3=81=ABWi-Fi=E6=8E=A5=E7=B6=9A=E7=8A=B6?= =?UTF-8?q?=E6=B3=81=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/k2ping.ino | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/src/k2ping.ino b/src/k2ping.ino index df2f9b7..3532e79 100644 --- a/src/k2ping.ino +++ b/src/k2ping.ino @@ -1,25 +1,40 @@ #include +#include +#include // 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() { - Serial.begin(9600); - Serial.println(); + lcd.begin(16, 2); WiFi.begin("network-name", "pass-to-network"); - Serial.print("Connecting"); + lcd.print("Connecting"); + lcd.setCursor(0, 1); while (WiFi.status() != WL_CONNECTED) { delay(500); - Serial.print("."); - } - Serial.println(); - Serial.print("Connected, IP address: "); - Serial.println(WiFi.localIP()); + 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() { ; -} \ No newline at end of file +}