Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jaminNZx committed Mar 2, 2017
1 parent 15fe16f commit a383b88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 4 additions & 1 deletion ESP8266-Remote-Blynk-Switch.ino
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#define BLYNK_PRINT Serial
#include <ArduinoOTA.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include "settings.h"
#include <wifi_credentials.h>

int switchState, timer1, switchDelay;
SimpleTimer timer;

void sendWifi() {
Blynk.virtualWrite(vPIN_INFO, map(WiFi.RSSI(), -105, -40, 0, 100) );
Blynk.setProperty(vPIN_INFO,"label", String("WIFI: ") + String(map(WiFi.RSSI(), -105, -40, 0, 100)) + String("%") );
}

BLYNK_WRITE(vPIN_BUTTON_TIMEOUT) { // remote delay switch
Expand Down Expand Up @@ -57,6 +59,7 @@ void Switch_Toggle(bool state) {

void setup() {
WiFi.mode(WIFI_STA);
Serial.begin(115200);
#if defined(LOCAL_SERVER)
Blynk.begin(AUTH, WIFI_SSID, WIFI_PASS, LOCAL_SERVER);
#else
Expand Down
9 changes: 2 additions & 7 deletions settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@
Blynk Auth Code
*/
#define AUTH "b9af72dccede40e195093c149688c4fb"
/*
Wifi Credentials
*/
#define WIFI_SSID "PrettyFlyForAWiFi"
#define WIFI_PASS "custom2015"
/*
Over The Air Hostname.
*/
#define OTA_HOSTNAME "REMOTE-SWITCH"
#define OTA_HOSTNAME "REMOTE-SWITCH-FRONT"
/*
Local Blynk Server Settings (uncomment to use local server and set address)
*/
//#define LOCAL_SERVER IPAddress(192, 168, 1, 2)
#define LOCAL_SERVER IPAddress(192, 168, 1, 2)
/*
Hardware Pins
*/
Expand Down

0 comments on commit a383b88

Please sign in to comment.