It is currently Mon Aug 21, 2017 7:42 pm

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun May 14, 2017 5:14 am 

Joined: Sun May 14, 2017 4:56 am
Posts: 1
Complex multi-gates system with several Arduino boards and radios communicating with a "central" unit.
When a gate is activated (open, stop, close), the gate controller sends a message to the central, where date, time, operation, user etc are logged on an SD high volume card. The central adds date and time to the log before writing it to the SD card, reading time and date from the Velleman RTC.
When connecting the PC to the controller (USB), using functions, I want to reset the date/time on the RTC, reading the PC date/time.
How could I do that?
(I can set the RTC manually, but I want it automatic, each time I connect the USB)
partial code:
void USB_command()
  char msg[100];
  int i;
  // execute a command from Arduino monitor
  // Read the header byte to determine the type of command
  msg[0] =;
  while (!Serial.available());
  switch (msg[0])
    case 0x01:  // Central request for log
    case 0x02:  // Write dummy log to SD card
void loop()
  if (key_check() > -1) // any key gets the menu (options such as download and erase LOGs from SD card)
  if (Serial.available()) // USB MESSAGE FROM MONITOR
    USB_command();        // execute the command, ie reset the clock
  if (ZetaSerial.available())  // ZETAPLUS MESSAGE FROM GATES

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group