Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Syntax & Programs / Re: Any tutorials on creating libraries ? on: September 26, 2007, 06:27:24 pm
hi, i see you have got the ds1307 working, i am trying to do the same but no luck. can you give me a few examples of how to read the time from the chip? am pretty sure i have it wired up correctly. SCL to analgue 5 and SDA to analogue 4. do i need to do anything with SQW?
2  Forum 2005-2010 (read only) / Interfacing / Re: Using interrupts and wire library? on: April 17, 2008, 03:50:40 pm
thanks will give that a try, took me ages to realise that might be why it wasn't working! at least now I know smiley
3  Forum 2005-2010 (read only) / Interfacing / Using interrupts and wire library? on: April 16, 2008, 05:35:48 pm
hi, I am trying to use an interrupt to call a function which uses the wire library, but it seems to crash at this point. Is it not possible? Eg i try this:

function i try to call:

void gettime()
{
// Below required to reset the register address to 0.
  Wire.beginTransmission(104);
  Wire.send(0x00);
  Wire.endTransmission();    
 
  Wire.requestFrom(104, 7);  
  second = Wire.receive();  
  minute = Wire.receive();  
  hour = Wire.receive();  
  day_of_week=Wire.receive();  
  day = Wire.receive();  
  month = Wire.receive();  
  year = Wire.receive();  
}

and where i attach interrupt:

attachInterrupt(0, gettime, CHANGE); //red wire

i can use interrupts for simple things like in the example, and my function gettime() works when not called from an interrupt. Is it because wire lib uses intterupts? any ideas would be welcome.

 thanks gazzy
4  Forum 2005-2010 (read only) / Interfacing / Re: LCD library not working with Arduino 0010? on: November 14, 2007, 06:41:33 pm
i had this problem too, think i sorted it by deleting a few lines in source. if its the 4bit library you are using try this http://rapidshare.com/files/69772115/LCD4Bit.zip.html it seems to work for me
5  Forum 2005-2010 (read only) / Interfacing / Re: i2c and a Dallas RTC Anyone?? on: November 14, 2007, 06:25:14 pm
I think to use I2C you have to use the analogue pins 4 and 5. if you look at the pin descriptions http://www.arduino.cc/en/Hacking/Atmega168Hardware you can see SCL and SDA are there. Maybe i'm wrong though and it is possible to use the digital pins.
Pages: [1]