15Views1Replies

Author Options:

button_input_led_output:115: error: variable or field 'handleMessage' ? Answered

Hi and thanks for your efforts with this course and in answering questions. I am using a generic esp8266 module and have managed to solve problems so far with my own research but this one has me stumped. I am getting the following error messages when compiling the button_input_led_output sketch:

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;

^

IOT_Class_LED_Button:5: error: 'int current' previously defined here

int current = 0;

^

button_input_led_output:46: error: redefinition of 'int last'

int last = 0;

^

IOT_Class_LED_Button:6: error: 'int last' previously defined here

int last = 0;

^

C:\Users\Heinz\Documents\Arduino\IOT_Class_LED_Button\button_input_led_output.ino: In function 'void setup()':

button_input_led_output:51: error: redefinition of 'void setup()'

void setup() {

^

IOT_Class_LED_Button: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);

^

C:\Users\Heinz\Documents\Arduino\IOT_Class_LED_Button\button_input_led_output.ino: In function 'void loop()':

button_input_led_output:82: error: redefinition of 'void loop()'

void loop() {

^

IOT_Class_LED_Button:13: error: 'void loop()' previously defined here

void loop() {

^

exit status 1
variable or field 'handleMessage' declared void

I am guessing that the problem lies with the AdafruitIO.h library which as discussed in the question 'AdafruitIO.h not loading' question is not highlighted in orange on my sketch. I have tried removing and reloading this library as well as loading previous versions, with no luck.

Your thoughts on this are greatly appreciated.

Regards Heinz

Discussions

0
None
bekathwia

Best Answer 23 days ago

It looks like you pasted the code more than once in your editor ("previously defined here" and "redefinition" errors). You should also check you have all the required libraries installed as described in the lesson, including the Adafruit IO Arduino library.