i need use arduino to drive a pair of switch at home. i just programming code to use arduino 1 with sensor and manual switch, and watch state on a 16x2 crystal led. Now i would add a wifi to use and verify state from my iphone.
Someone can help me about to add wifi and configure it?
best regards
Alex
@alessio72
Installation and Troubleshooting is for Problems with the Arduino itself NOT your project. It says so in the description of the section. Therefore I have moved your post here.
It will tell you all the things you have to include before anyone can help you.
Like a schematic, the code you are trying to run. If you have tried the library examples for your LCD? And exactly what happens when you run the code.
this is my code about pump control.
work great. now i would monitor and control led status and pin 6 from my iphone but for me is impossible to add this function.
I just study esp8266 but i do not find right code for my case. can you help me? regards
#include <LiquidCrystal.h>
const int rs=12, en=11, d4=5, d5=4, d6=3, d7=2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
// setto case 4 in modo che se manca corrente
//alla ripartenza la pompa in posizione ON
// e poi si adegua in funzione della posizione
//del galleggiante
int stato = 4;
void pompaon() {
digitalWrite(13, HIGH);
lcd.setCursor(0, 1);
lcd.print("Pompa OFF FORZAT");
delay(400);
}
void setup() {
lcd.begin(16, 2);
Serial.begin(9600);
pinMode(7, INPUT);
pinMode(8, INPUT);
pinMode(6, INPUT);
pinMode(13, OUTPUT);
}
void loop() {
//prima riga display fissa
lcd.setCursor(0, 0);
lcd.print(" Lavanderia ");
//leggo galleggiante
int lmin = digitalRead(7);
int lmax = digitalRead(8);
int test = digitalRead(6);
Serial.print("stato: ");
Serial.println(stato);
Serial.print("min: ");
Serial.println(lmin);
Serial.print("max: ");
Serial.println(lmax);
//pulsante test
switch(stato) {
case 1:
digitalWrite(13, LOW);
if ((lmin == LOW) && (lmax == HIGH) && (test == LOW)) stato = 2;
if (test == HIGH) pompaon();
lcd.setCursor(0,1);
lcd.print("Pompa OFF ");
break;
case 2:
digitalWrite(13, LOW);
if ((lmin == LOW) && (lmax == LOW) && (test == LOW)) stato = 3;
if ((lmin == HIGH) && (lmax == HIGH) && (test == LOW)) stato = 1;
if (test == HIGH) pompaon();
lcd.setCursor(0,1);
lcd.print("Pompa OFF ");
break;
case 3:
digitalWrite(13, HIGH);
if ((lmin == LOW) && (lmax == HIGH) && (test == LOW)) stato = 4;
lcd.setCursor(0,1);
lcd.print("Pompa ON ");
break;
case 4:
digitalWrite(13, HIGH);
if ((lmin == LOW) && (lmax == LOW) && (test == LOW)) stato = 3;
if ((lmin == HIGH) && (lmax == HIGH) && (test == LOW)) stato = 1;
lcd.setCursor(0,1);
lcd.print("Pompa ON ");
break;
}
delay(200);
}