Reading Date from Laptop in Arduino

Hi all,

I am trying to read the date from my laptop to use it in Arduino. By searching through the forum I understood that GoBetwino could do it. I downloaded GoBetwino 0.5 and got the proper code for date in its manual:

Serial.println("#S|D|#")

But I did not figure it out how to correlate Arduino 1.8.12 and GoBetwino 0.5 together, and what is the process to read the date.

Hope my explanation would be clear. It would be great to have your help to know the process to solve my problem.

Thanks

mahagh:
Hi all,

I am trying to read the date from my laptop to use it in Arduino. By searching through the forum I understood that GoBetwino could do it. I downloaded GoBetwino 0.5 and got the proper code for date in its manual:

Serial.println("#S|D|#")

But I did not figure it out how to correlate Arduino 1.8.12 and GoBetwino 0.5 together, and what is the process to read the date.

Hope my explanation would be clear. It would be great to have your help to know the process to solve my problem.

Thanks

if you want to view the date string returned you probably will need to setup a second serial port to output the string to and use a serial terminal (putty or like) to view the returned string (or printing it out some kind of display would be another option).

a code like this one may work for the above scenario:
(compiles, not tested)

#include <SoftwareSerial.h>

SoftwareSerial mySerial(4, 5); // RX, TX

void setup() {
  Serial.begin(115200); //this will be the COM port selected in gobetwino

  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600); //this will be the COM port that would be used in Putty for example

  //send Date command type to gobetwino
  Serial.println("#S|D|[]#");

  delay(10); //arbitrary 10ms delay (to give PC time to reply)

  //output returned data string to software serial port. alternatively could store it into a char array...
  while (Serial.available()) {
    mySerial.print(Serial.read());
  }

  mySerial.println("");

}

void loop() {

}

hope that helps…

mahagh:
Serial.println("#S|D|#")

But I did not figure it out how to correlate Arduino 1.8.12 and GoBetwino 0.5 together, and what is the process to read the date.

No surprise there. Apparently the powers that be at Gobetwino haven't either. I recall that, some years ago, something like your problem led me to conclude that gobetwino was junk. I have just looked at the manual, there is no example, so indeed it is still junk. I concluded that I was on the wrong tram anyway.

So what do you do? You might start by reviewing your needs, and I can't even guess as to why you need to send the date from PC to Arduino. Since PC and Arduino must be connected to do that anyway, you might find it easier to send whatever needs to be involved with date from Arduino to PC. You might find that a proper terminal problem is all you need. Another possibility is PLX. Come to think of it, I believe PLX supports two-way traffic, so it may be possible to send the date from Excel.