This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--plant doctor, smart pot system, esp-12 standalone wiring | |
-- | |
--ds18b20 on GPIO5/pin2 | |
--photocell on GPIO4/pin1 | |
--soil probes on ADC/id=0 | |
--R on GPIO13/pin7 - set low first | |
--G on GPIO12/pin6 - set low first | |
--B on GPIO14/pin5 - set low first | |
-- | |
-- GPIO15 & GND on ESP to GND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
int sensor_temp = A2; | |
int value_temp; | |
int sensor_light = A1; | |
int value_light; | |
int sensor_water = A0; | |
int value_water; | |
int red = 9; | |
int green = 8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Setting up WIFI...") | |
wifi.setmode(wifi.STATION) | |
--modify according your wireless router settings | |
wifi.sta.config("SSID","PASS") | |
wifi.sta.connect() | |
tmr.alarm(1, 1000, 1, function() | |
if wifi.sta.getip()== nil then | |
print("IP unavaiable, Waiting...") | |
else |