Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3, 4  Next
Data Logger Shield (HCARDU0093) 
Author Message

Joined: Thu Nov 20, 2014 3:35 pm
Posts: 9
Post Re: Data Logger Shield (HCARDU0093)
When I attempt to compile the first example sketch "Data_Logger_Shield_HCARDU0093_Example" I get the following error:
Arduino: 1.6.4 (Linux), Board: "Arduino Uno"
<snip>
/home/william/ArduinoProgs/libraries/HCRTC/HCRTC.cpp: In constructor 'HCRTC::HCRTC()':
/home/william/ArduinoProgs/libraries/HCRTC/HCRTC.cpp:35:2: error: 'Wire' was not declared in this scope
Wire.begin();
and on lines: 113:4:131:4:158:3:166:3:172:3:178:3:187:3:

I have pared down to the following code that has the problem;

// start sketch
#include <HCRTC.h>
void setup()
{}
void loop()
{}
// end sketch

Arduino: 1.6.4 (Linux), Board: "Arduino Uno"
Using library HCRTC in folder: /home/william/ArduinoProgs/libraries/HCRTC (legacy)
<snip>
/home/william/ArduinoProgs/libraries/HCRTC/HCRTC.h:33:18: fatal error: wire.h: No such file or directory
#include "wire.h"
^
compilation terminated.
Error compiling.


I am using Arduino 1.6.4 in Ubuntu. The following sketch does compile.

// start
#include <Wire.h>
void setup()
{}
void loop()
{}
//end

The compiler can find the wire library. Please could you help.

Regards, William.


Sun May 17, 2015 9:43 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 629
Post Re: Data Logger Shield (HCARDU0093)
Can you try adding the following line to the top of the sketch:

Code:
#include <SPI.h>


I think that will fix it. If so I'll get the sketch updated.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Mon May 18, 2015 9:10 am
Profile

Joined: Thu Nov 20, 2014 3:35 pm
Posts: 9
Post Re: Data Logger Shield (HCARDU0093)
Thanks. The sketch certainly compiles now. Interestingly, I just downloaded the older Arduino software 1.0.6 and the original sketch compiles.
Regards.
William.


Mon May 18, 2015 10:28 am
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 629
Post Re: Data Logger Shield (HCARDU0093)
Thanks for confirming. Arduino probably changed the order in which libraries are compiled in the latest version of the IDE. That line is actually included HCRTC library but it looks like on newer versions of the IDE it needs it to be in the sketch itself. I'll get the example sketch updated.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Mon May 18, 2015 1:02 pm
Profile

Joined: Thu May 21, 2015 2:15 pm
Posts: 1
Post Re: Data Logger Shield (HCARDU0093)
Hello,

I just got one of these shields and I am facing a weird problem. When I use it, Arduino only starts looping once I open the serial monitor, and it stops when closing it. I have tried with the provided sample program and happens the same. Any thoughts?

Thanks a lot!!


Thu May 21, 2015 2:39 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 629
Post Re: Data Logger Shield (HCARDU0093)
That is weird. Do you get the same weird behaviour if you try it with something else such as the blink sketch or better still one of the serial port example sketches? Try them with and without the shield connected. If they seem to work can you try the example sketch in the 5th post down on the first page of this thread

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Fri May 22, 2015 7:20 am
Profile

Joined: Mon Jan 18, 2016 12:05 pm
Posts: 1
Post Re: Data Logger Shield (HCARDU0093)
Hi,

The shield works fine with my UNO. However, I can't get it to work with a DUE. I am having problems with the instance of HCRTC library. If I uncomment this line board will print to the serial. However, if this line is active nothing prints to the serial.

thank you for your help

p.d. So I just realized that in the description it says the shield is for the UNO, Leonardo and Mega. Will it not work for the DUE? Is a firmware update expected for the shield to work with the DUE. thank you


Mon Jan 18, 2016 12:25 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 629
Post Re: Data Logger Shield (HCARDU0093)
For some reason when the HCRTC library is complied for a Due it does't like the wire library initialisation function being run when an instance of the library is created. I'll get this moved when the library is next updated but for a quick fix open up the HCRTC.cpp file in a text editor and change this:

Code:
HCRTC::HCRTC(void)
{
   Wire.begin();
}


to this:

Code:
HCRTC::HCRTC(void)
{
   //Wire.begin(); <- COMMENT OUT THIS LINE
}



Save it and then in the setup() function in your main sketch add this as the first line:

Code:
Wire.begin();

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Mon Jan 18, 2016 2:27 pm
Profile

Joined: Wed Apr 20, 2016 10:28 pm
Posts: 2
Post Re: Data Logger Shield (HCARDU0093)
Hi! I bought on ebay this module some day ago.
I have problem to run it: I'm able to set the current time but when I read it the value (hour and date) is not correct (I try to change the battery so I think that it is not the problem).
I use Arduino Uno R3.

I readed some old post and I tried differet libraries:

1)
Time.h https://www.pjrc.com/teensy/td_libs_Time.html
DS1307RTC-master https://www.pjrc.com/teensy/td_libs_DS1307RTC.html
With the example I correctly set the time, but when I run the read example I obtain always the same data and hour (different from the one that I set).

2)
RTClib.h https://github.com/adafruit/RTClib
With the example sd1307 (I correcly uncommented the set time line) I don't obtaine the correct hour and date and the time don't update: on monitor always the same hour is printed.

3)
HCRTC.h https://github.com/dtu-mekatronik/HCRTC. (Library indicated in this forum)
With this one I'm able to set the time, but when I read the hour I receive in output alway the same result (the settled value).
I attach the sketch, there is something wrong?

Code:
//SET TIME AND READ VALUE

/* Include the wire library */
#include <Wire.h>
/* Include the Hobby Components RTC library */
#include <HCRTC.h>
/* Include the SPI library */
#include <SPI.h>

/* The RTC has a fixed addresses of 0x68 */
#define I2CDS1307Add 0x68

/* Create an instance of HCRTC library */
HCRTC HCRTC;

void setup(){
  /* Initialise the serial port and wire transmission*/
  Serial.begin(9600);
  Wire.begin();
  Wire.beginTransmission(0x68);
 
  /* Read the current time from the RTC module */
  HCRTC.RTCWrite(I2CDS1307Add, 16, 4, 23, 15, 2, 0, 5);
}

void loop(){
  /* Read the current time from the RTC module */
  HCRTC.RTCRead(I2CDS1307Add);
   
  /* Lets output this data to the serial port */
  Serial.print(HCRTC.GetDay());
  Serial.print("/");
  Serial.print(HCRTC.GetMonth());
  Serial.print("/");
  Serial.print(HCRTC.GetYear());
  Serial.print(" ");
   
  Serial.print(HCRTC.GetHour());
  Serial.print(":");
  Serial.print(HCRTC.GetMinute());
  Serial.print(":");
  Serial.print(HCRTC.GetSecond());
  Serial.print(" DOW:");
  Serial.println(HCRTC.GetWeekday());
  delay(2000);
}


Sat Apr 23, 2016 1:07 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 629
Post Re: Data Logger Shield (HCARDU0093)
Quote:
HCRTC.h https://github.com/dtu-mekatronik/HCRTC. (Library indicated in this forum) With this one I'm able to set the time , but when I read the hour I receive in output alway the same result (the settled value).
I attach the sketch, there is something wrong?


I assume that the seconds also do not change?

When using the HCRTC library what time and date do you actually read back out of the module? It may give a clue as to the problem.

Also, although you've posted in the Data logger shield thread I assume it is not actually this product but something else? Is it defiantly using a DS1307 for the RTC?

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Mon Apr 25, 2016 2:38 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 36 posts ]  Go to page Previous  1, 2, 3, 4  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD