i have been using esp8266 for a light dimming project via firebase and i ave aldredy coded the program and complied it by arduino ide but then also there is an error while running the esp that is in sreial monitor it shows errors so i have bin used to find by the esp expation decoder and found the error but the language cant be understood by me please i request to have a hint regarding these issue i have been attached the code and the error please check it out ...
these is the error
Decoding 4 results are :
0x40202511: setup at C:\Users\Asus\Documents\Arduino\robov2/robov2.ino line 43 (discriminator 1)
0x40207900: loop_wrapper at
C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/
core_esp8266_main.cpp line 56
0x40100718: cont_norm at C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/ cont.S line 109
for (int a = led1 ; led1 <= 255 ; a++)
{
pinMode(led1, OUTPUT);
}
this code does the following:
start variable a with value of led1 increment variable a
as long as value of led1 is smaller than or equal to 255
led1 is a constant with value 12
the condition inside a for-loop says go on looping as long as condition is true
the condition led1 <= 255 is always true. because led1 has the constant value 12
12 <= 255
a = 0 condition 12 <= 255 is true go on looping
a = 1 condition 12 <= 255 is true go on looping
a = 2 condition 12 <= 255 is true go on looping
a = 3 condition 12 <= 255 is true go on looping
.......
a= 32767 condition 12 <= 255 is true go on looping
rollover of value inside variable a
a = 0 condition 12 <= 255 is true go on looping
a = 1 condition 12 <= 255 is true go on looping
...... ...... .... until watchdogtimer causes a reset of your ESP8266-board
Your ESP8266 only a small number of IO-pins
Your loop
for (int a = led1 ; led1 <= 255 ; a++)
{
pinMode(led1, OUTPUT);
}
for (int a = led1 ; led1 <= 255 ; a++)
{
pinMode(led1, OUTPUT);
}
This whole statement is just wrong, led1 has a value, it is assigned to 'a' but the condition for exiting the for loop is 'led1 <= 255' , if it was true initially it will stay true, causing an infinite loop, which causes a wdt reset after 2.5 secs. I am not quite sure what the purpose of this loop is, but it would not be part of 'any' functional program. And yeah, what board are you using ? How many pins does it have, and what do you want them to do ?
first sending the variables that is ranging from 0 to 255.
i want to get a variable value form firebase that ranges from 0 to 255; that is sending analog data to firebase and get data from it.
then processing or putting the received data from fire base to a" esp8266nodemcu " micro controller board
that has about 11 gpio pins.
so that i can control the rgb leds individually; that is changing the analog values via internet and getting it to the board and changing the intensity of each rgb lights so that i can get whole spectrum of light .
this all about the project.
and i have coded the things as required , but because of some errors of the loops i cant do it .
so please tell me what i can do regrading these or any other alternative in coding part so that i can solve all these problem.
thanks for all your efforts
a = Firebase.getInt("Variable1/Value") ;
for ( a ; a <= 255 ; a++ );
{
analogRead(a);
analogWrite(led1, a);
Serial.println("led started");
delay(10);
}
what is the plan ? i mean what is this supposed to do ? you get a value, and then you increase the value and write it to the led1 pin, okay, but then analogRead(a);this does what ? you should read up on analogRead() It should have no effect, you read from a pin which probably doesn't exist, but the return value is not assigned to anything, so it should get optimized out by the compiler. You should consider what happens when the variable is assigned with a negative value, but that is a different matter.
Keep in mind that the Pinout of the nodeMCU is dual-referenced. There are references on the silk that show D1, D2, D3 etc. these can be referenced in your sketch exactly like that D1, D2 etc. and there are the GPIO numbers which can be referenced without the 'D' in front as you have been doing. Just in case why don't you show us a schematic of how everything is connected.
the baudrate of the serial-monitor must be adjusted to 115200 baud too.
The baudrates in your code and in the serial monitor must match = they must be the same value.