thandana
Junior Member level 1
- Joined
- Nov 27, 2014
- Messages
- 19
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 367
Hi,
I found this sketch in the internet on how to read/set the time in the SIM900 GSM shield:
I have an issue that everytime the time is read, it doesn't show the whole time, it sometimes leaves some digits out. Please see attached output.
Any help will be highly appreciated.
Code:
I found this sketch in the internet on how to read/set the time in the SIM900 GSM shield:
I have an issue that everytime the time is read, it doesn't show the whole time, it sometimes leaves some digits out. Please see attached output.
Any help will be highly appreciated.
Code:
Code:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
int i=0;
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(19200);
// set the data rate for the SoftwareSerial port
mySerial.begin(19200);
// mySerial.println( "AT+CCLK =\"14/11/12,10:43:50+08\"");
}
void loop() // run over and over
{
delay(50);
if (mySerial.available())
Serial.write(mySerial.read());
delay(50);
mySerial.println( "AT+CCLK?" );
delay(50);
if (mySerial.available())
Serial.write(mySerial.read());
delay(50);
i++;
if (i==50)
{
mySerial.flush();
i=0;
}
}