I can not seem to get this to work...maybe I am being an idiot but:
Datasheet -> DS1307 RTC IC datasheet
My code:
#include <Wire.h>
byte control_reg_addy = 7;
byte data_to_write_to_reg = B10010000;
byte dev_i2c_addy = 0x68;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Wire.write(dev_i2c_addy);
Wire.write(control_reg_addy);
Wire.write(data_to_write_to_reg);
}
void loop() {
// put your main code here, to run repeatedly:
}
The chip works, it does output the correct time and increments every second.
I want to turn on the output pin (IC pin 7) that toggles every second (optional...1Hz, ~4KHz, ~8KHz and 32.768Khz) by setting the bits in the control register (address = 7).
The device has an i2c address of 0x68.
I have a 330ohm resistor and a green LED on the output pin. Switched out the LED etc and also tested with a multi-meter.
Where am I going wrong?
EDIT: PS If I can use the Wire library to accomplish this rather than writing my own bit-bang code that would be great!