How can I sincronize a computer's clock with a basic stamp 2
Pantro040475
Posts: 8
Hi, need help to sincronize a computer's clock with a basic stamp.
What I'm trying to do is to turn on an alarm in a different time of the day and I need to know if there is a command for the BS2 to do this.
Thank you.
Miguel zepeda.
What I'm trying to do is to turn on an alarm in a different time of the day and I need to know if there is a command for the BS2 to do this.
Thank you.
Miguel zepeda.
Comments
You could also go the other way and update the RTC from Windows - it will be a mutli-layer application in any case...
What command do I have to use to comunnicate the BS2 with the computer?
Thank you.
You want the Basic Stamp to obtain the current time from your Windows computer, correct?
If that's your goal, you need to have a program running on the computer and a serial connection between them.
If you are using one of the Parallax boards like the Board of Education (with a 9 pin serial port or USB port), you can use the programming cable to communicate.
What PC programming experience do you have?
You can use various languages such as Visual Basic, C++, etc or even a VBScript to get the PC time and send it to the Basic Stamp. If you are not changing the PCs time, it should be pretty simple (depending on your PC programming skill level)...
You woud use the BS2 Serin and Serout commands.
Why do you need to get the time?
I have little experience in programming, We need to get the time because we have a computer controlling a ID checker for workers, it register at what time they come in and go out and now we have to use the computer's clock to turn on a buzzer.
Thank you.
'
Take a look at Just Basic.com, Its a free compiler.
'
Theres an example code called "Clock2.BAS" in the example folder that might be of help to you. It reads the PC's clock and displays it graphically.
'
Also take a look at the serial example "TERMINAL.BAS",It shows how to open a com port.
'
You can use the program/debug line to talk to your PC.(RS232) with the Basic Stamp.
http://www.extraputty.com/features.html <=== Take a look here. This is 'ExtraPutty'
PuTTY is a public domain free download version of software equal to TELNET and ExtraPuTTY has the timestamp feature you require.
I am not sure if the latest Windows still comes with TELNET that includes a timestamp feature.
Otherwise, entering the lines of code below at the command prompt or in a test file with a bat extension will send the date and time to COM3 at 2400 baud. No compiler needed. With a little research and Windows scheduler, I'm sure you can come up with appropriate logic to accomplish the task.