arduinoのとのインターフェイスのI2C EEPROM(AT24C32A)

B

badri89

Guest
ボイドi2cexeepromwrite(int型slaveaddress、int型whichaddress、intデータ){Wire.beginTransmission;こんにちは私は#[コード] Arduinoを使用して、次のプログラムを使用して外部EEPROM(AT24c32a)に温度センサの測定値を記録するためにint型端子= 0が含ましようとしている(slaveaddress); Wire.send(whichaddress>> 8); Wire.send(whichaddress&0xFF)の; Wire.send(データ); Wire.endTransmission();遅延(100);}バイトi2cexeepromread(int型slaveaddress、int型whichaddress ){int型解像度; Wire.beginTransmission(slaveaddress); Wire.sendは((バイト)whichaddress)> 8>; Wire.sendを((バイト)whichaddress&0xFF)の; Wire.endTransmission(); Wire.requestFrom(slaveaddress、1 );(Wire.available())resは)(Wire.receive =場合はtrueを返すresを;}ボイドセットアップ(){Wire.beginを(); Serial.begin(9600);}ボイドループ(){int型valは、 ;一時フロート;ヴァル= analogRead(ピン)気温=(5 * valは* 100)/ 1024; Serial.println(気温)、(の= 0;> 8それはおきましょう> 6と同様に0xffの? ?私を明確にしてください。
 

Welcome to EDABoard.com

Sponsor

Back
Top