This is my first post on this BB so please be kind and find me welcoming all of you.
I bought today esp8266. I also have arduino leonardo.Since i've been programming arduino earlier i have no idea why it doesnt want to cooperate with esp.
I connected esp to arduino:
power to 3.3 power on arduino
gnd to arduino gnd
tx on arduino to rx on esp via current stabilizer (5 to 3.3 v)
rx on arduino to tx on esp
I havent uploaded any firmware (i do not have any usb-uart device to do this). esp turns on (i have red led indicating that it is powered on) but blue led is turned off.If i put led to stabilized 3.3 voltage from tx it lights up constantly as if some data data would be sent all the time (or not? not sure of that).
My sketch looks like this.
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
while(!sendAT("AT", "OK", 100))
{
Serial.println("Error !");
if ( Serial1.available() > 0 ) { Serial.println("serial 1 available"); } else { Serial.println("serial 1 is not available"); }
delay(1000);
}
Serial.println("Comms ok!");
}
void loop() {
}
boolean sendAT(String at, char *response, int time)
{
Serial1.println(at);
delay(time);
while(Serial1.available() > 0);
{
if (Serial1.find(response)) {
return 1;
}
}
return 0;
}
Serial monitor returns Error and no Comm information. I have no idea what is wrong. Can anybody help me please?