Go Down

Topic: back on the HT12 project again (Read 1 time) previous topic - next topic

Boffin1

Nov 10, 2010, 10:48 am Last Edit: Nov 10, 2010, 01:49 pm by John_Smith Reason: 1
The Holtek HT12 is an encoder/decoder pair of chips used for many years in remote controls etc.
There is an Arduino library that is for decoding the signal but I can't seem to get it to compile.
I get the message below. I cannot find a "double" in the cpp file???

Any ideas?


Code: [Select]
In file included from H:\arduino\arduino-0021\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:6
,
               from HT12example.cpp:3:
h:/arduino/arduino-0021/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/includ
e/math.h:439: error: expected unqualified-id before 'double'
h:/arduino/arduino-0021/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/includ
e/math.h:439: error: expected `)' before 'double'
h:/arduino/arduino-0021/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/includ
e/math.h:439: error: expected `)' before 'double'

RuggedCircuits

Have a look here:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285544974

It sounds like you have a "round" function or macro defined somewhere before math.h gets included and that is causing confusion.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons

Boffin1

#2
Nov 10, 2010, 08:53 pm Last Edit: Nov 10, 2010, 08:54 pm by John_Smith Reason: 1
Thanks for the post, I checked out the link, but I think thats a bit over my head as a newbie, I did look  in the HT12 h and cpp files, but I am not sure where else to look......

RuggedCircuits

Can you post the whole code somewhere? Maybe someone can spot something you haven't.

--
The Quick Shield: breakout all 28 pins to quick-connect terminals

Boffin1

Heres the ccp and h files with an example from the author :-

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1213063480/0

RuggedCircuits

Try removing the #include "WProgram.h" line from the HT12.cpp file. That seemed to fix it in the other thread I mentioned.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons

Boffin1

Thanks a lot, I will try that today

Boffin1

#7
Nov 12, 2010, 09:18 am Last Edit: Nov 12, 2010, 09:20 am by John_Smith Reason: 1
Well its different now, after removing ( commenting out ) the "WProgram.h" line in the ccp file..... it looks like it needs something from that library too....

Code: [Select]
D:\arduino\arduino-0021\arduino-0021\hardware\arduino\cores\arduino/wiring.h: In member function 'int HT12E::read()':
D:\arduino\arduino-0021\arduino-0021\hardware\arduino\cores\arduino/wiring.h:119: error: too few arguments to function 'long unsigned int pulseIn(uint8_t, uint8_t, long unsigned int)'
D:\arduino\arduino-0021\arduino-0021\libraries\HT12E\HT12E.cpp:31: error: at this point in file
D:\arduino\arduino-0021\arduino-0021\hardware\arduino\cores\arduino/wiring.h:119: error: too few arguments to function 'long unsigned int pulseIn(uint8_t, uint8_t, long unsigned int)'
D:\arduino\arduino-0021\arduino-0021\libraries\HT12E\HT12E.cpp:60: error: at this point in file

Boffin1

In the ccp file there is
Code: [Select]

#include "WProgram.h"
#include "HT12E.h"

HT12E::HT12E(int pin, unsigned int addrMask)
{
 _pin = pin;
 pinMode(_pin, INPUT);
 _data = 0;
 _mask = addrMask << 4;  // the HT12E basic word is a stream with an 8-bit address
                         // followed by 4-bit data. I left shift the
                         // address mask 4 bits so I can match it to the entire word
}



Does the  HT12E::HT12E(int pin, unsigned int addrMask) look right to you guys?

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy