8Views1Replies

Author Options:

Unable to upload the code to my ESP-01.? Answered

Hey there,
I followed the instructable as directed and just modified the pin numbers so as to match with ESP-01 module, though I was able to upload all the previous codes but when I try to upload the push button code to my ESP it shows a long error and it is something related to the AdafruitIO.h file and yes I installed all the libraries correctly but this is the only one which isn't turning orange when I try to include the "" file. The error that I am getting is:
"Arduino: 1.8.1 (Mac OS X), Board: "Generic ESP8266 Module, 80 MHz, ck, 26 MHz, 40MHz, DIO, 512K (64K SPIFFS), 0, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

button_input_led_output:115: error: variable or field 'handleMessage' declared void
void handleMessage(AdafruitIO_Data *data) {
^
button_input_led_output:115: error: 'AdafruitIO_Data' was not declared in this scope
button_input_led_output:115: error: 'data' was not declared in this scope
void handleMessage(AdafruitIO_Data *data) {
^
button_input_led_output:45: error: redefinition of 'int current'
int current = 0;
^
espButtonTest:5: error: 'int current' previously defined here
int current = 0;
^
button_input_led_output:46: error: redefinition of 'int last'
int last = 0;
^
espButtonTest:6: error: 'int last' previously defined here
int last = 0;
^
/Users/mac/Documents/Arduino/espButtonTest/button_input_led_output.ino: In function 'void setup()':
button_input_led_output:51: error: redefinition of 'void setup()'
void setup() {
^
espButtonTest:8: error: 'void setup()' previously defined here
void setup() {
^
button_input_led_output:68: error: 'handleMessage' was not declared in this scope
command->onMessage(handleMessage);
^
/Users/mac/Documents/Arduino/espButtonTest/button_input_led_output.ino: In function 'void loop()':
button_input_led_output:82: error: redefinition of 'void loop()'
void loop() {
^
espButtonTest:13: error: 'void loop()' previously defined here
void loop() {
^
exit status 1
variable or field 'handleMessage' declared void
"

Discussions

None
bekathwia

Best Answer 4 days ago

The errors suggest that you have pasted the sample code twice in your sketch ("redefinition of..." errors).