i can't seem to get this working and ive tried i think every possable way to get it to work. btw i bought it at http://www.robotshop.us/inex-serial-real-time-clock.html it has some PDF files on the board. if someone can tell me how to correction wire and interface it with an arduino that would be very helpfull. ive searched google and read teh manuel many times and still can't get it to work.
sry this got posted 3 times. i had a 500 server error wile posting it so i guess each time i reloaded the page it reposted it
Can you post your sketch?
What isn't working?
You should probably be using SoftwareSerial.
Single input/output pin might be tricky though.
i don't think still have the sketch because i had given up and was starting over and also i tryied doing things that interfaced with atual chip that has the clock. but the one i tryed with the teh serial(since i learned that the time chip uses I2C) it was similar to this
char timein = Serial.read();
pinMode(spin, OUTPUT);
serial.print(timein);
pinMode(spin, INPUT);
char timeout = serial.read();
Serial.println(timeout);
that much i do remember from my first attempt
UPDATE
i removed the battery and tryed running the program and all i get is some wierd(but consisten and only when the clock is hooked up so i don't think its noise) charaters or when i change the line that reads the command to an int instead of char then it displays the number 177...
btw here is my current code
#include <SoftwareSerial.h>
#define spin 3
SoftwareSerial serial = SoftwareSerial (spin,spin);
byte pinstate =0;
void setup(){
Serial.begin(9600);
serial.begin(9600);
}
void loop(){
//char timeout=Serial.read();
pinMode(spin,OUTPUT);
serial.print("T"); // command to read time
pinMode(spin,INPUT);
char time = serial.read();
Serial.print(time);
delay(500);
}
that is my current program
You're sending a "T", but you're not reading 12 characters - you're just reading one character, waiting half a second and then sending another "T" when "loop" repeats..
Try reading 12 characters instead of just one.
Otherwise -looking quite hopeful - you've got the setting of the pinMode, I think
See your first post http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1256403922 for more information on half-duplex.