HomeEasy Library

Hi,

I'm trying to use the library example on the playground's HomeEasy page. My code won't compile though - says "'boolean' has not been declared"

What is wrong with my code?? :-/

#include <HomeEasyTransmitter.h>

HomeEasyTransmitter HomeEasyTransmitter(2);

void setup() {
  
}

void loop() {
HomeEasyTransmitter.setSwitch(true , 2491418, 6);
delay(3000);
HomeEasyTransmitter.setSwitch(false, 2491418, 6);
delay(3000);
}

Looking at the example code there suggests adding at the top:

#include "WProgram.h"

Hey, thanks. That seems to work. Can you tell a newb like me why?

Because boolean is not a native type. There is a typedef statement in WProgram.h that defines the type.

Really?

boolean - Arduino Reference seems to indicate it is native.

I'm not trying to be smart here, just trying to comprehend things........

Thats becuse the arduino add the file WProgram.h automatic as the first setp in building. ( Thats where you fin boolean. )
"The Arduino environment performs a few transformations to your main sketch file (the concatenation of all the tabs in the sketch without extensions) before passing it to the avr-gcc compiler.

First, #include "WProgram.h" is added to the top of your sketch. This header file (found in /hardware/cores//) includes all the defintions needed for the standard Arduino core. " from http://arduino.cc/en/Hacking/BuildProcess.
but it does not add this to libraries.

  • Joakim