I am trying to get the arduino UNO to time stamp data when the pinButton is pressed. Below is the time stamp code, but it keeps saying (call of overloaded 'println(String (&)())' is ambiguous). I don't understand why. Can anyone offer suggestions on how to correct this?
// Date Time stamping data
// This is in theory supposed to talk to the real time clock but in reality doesn't work
#include "Wire.h"
#define DS1307_I2C_ADDRESS 0x68 // This is the I2C address
// Global Variables
int i;
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
//...some other start up code
// Now stamp some data
// Gets the date and time from the ds1307 and return
// result in a format a spreadsheet can parse: 06/10/11 15:10:00
String getDateDs1307();
void setup()
{
Serial.begin(9600);
}
void loop(){
// Serial.println(dayOfWeek); // (for some reason keeps printing 0's.)
Serial.println(getDateDs1307);
}
If I purchased a RTC module, such as a DS3231 would that allow my code to work?
Is it possible to get the arduino to sync to the NTP site, to sync the time in the beginning so it will be in sync with up to date real time information, then to disconnect from the NTP and continue on by itself using millis without pinging the NTP site each time for a time update? Or would that be to much code? Network Time Protocol - Wikipedia
My buddy that graduated sent me the code (as is) in the attachment and said it should work and be easy to add to another project. (I live in a frat house and want to give the room mates a good laugh)
Right now I am just experimenting with simple examples, eventually i'd like to use the arduino as bluetooth beacon that way if it's after 11pm and the bed room door opens the arduino will send a bluetooth beacon message to any registered smart phones that says (if you brought her home from the bar, might be a good idea to ask the room mate for approval), but I'm trying to understand the simple stuff before I move to something that advanced.
I am not sure how to define it. Didn't String getDateDs1307(); define it?
I want the arduino to store the date (timestamp) when the PinButton was pressed. I am trying to get the arduino to take the time from the computer. I have not yet purchased a RTC module, but I can if that is necessary.
The outcome I am trying to reach is when PinButton is pressed, it timestamps 7:30 11/9/2014 on the serial.println and eventually would like to integrate it to the client.print web server program. A buddy of mine sent me the code I posted in the first message, and gave me the impression it would take the timestamp from the computer (lower left corner) and integrate it to the arudinos program.
You are making a call to a function that we presume is in a library.
If that is the case, then is the library included in the sketch? If not then it needs to be. If it is, have you got the library installed in you Arduino IDE?