Pages: [1]   Go Down
Author Topic: back on the HT12 project again  (Read 938 times)
0 Members and 1 Guest are viewing this topic.
Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1189
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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'
« Last Edit: November 10, 2010, 07:49:29 am by John_Smith » Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

0
Offline Offline
Faraday Member
**
Karma: 13
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1189
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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......
« Last Edit: November 10, 2010, 02:54:37 pm by John_Smith » Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

0
Offline Offline
Faraday Member
**
Karma: 13
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1189
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

With my mobile phone I can call people and talk to them -  how smart can you get ?

0
Offline Offline
Faraday Member
**
Karma: 13
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1189
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot, I will try that today
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1189
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
« Last Edit: November 12, 2010, 03:20:16 am by John_Smith » Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1189
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In the ccp file there is
Code:
#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?
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Pages: [1]   Go Up
Jump to: