Modifications

Sauter à la navigation Sauter à la recherche
674 octets ajoutés ,  9 mars 2013 à 21:46
aucun résumé de modification
Ligne 4 : Ligne 4 :     
http://arduino.cc/en/Tutorial/MasterWriter
 
http://arduino.cc/en/Tutorial/MasterWriter
 +
 +
<nowiki>Reading data from the DS1307 should be easy for you now, reset the register pointed, then request seven bytes of data and receive them into seven variables. The device address is 0×68.  For example:
 +
 +
Wire.beginTransmission(0x68);
 +
 +
Wire.write(0);
 +
 +
Wire.endTransmission();
 +
 +
Wire.requestFrom(DS1307_I2C_ADDRESS, 7);
 +
 +
*second    = bcdToDec(Wire.read();
 +
 +
*minute    = bcdToDec(Wire.read();
 +
 +
*hour      = bcdToDec(Wire.read();
 +
 +
*dayOfWeek  = bcdToDec(Wire.read());
 +
 +
*dayOfMonth = bcdToDec(Wire.read());
 +
 +
*month      = bcdToDec(Wire.read());
 +
 +
*year      = bcdToDec(Wire.read());
 +
</nowiki>
 +
http://tronixstuff.wordpress.com/2010/10/20/tutorial-arduino-and-the-i2c-bus/
    
== Broches I2C pour Arduino ==
 
== Broches I2C pour Arduino ==
29 836

modifications

Menu de navigation