Здравствуйте, пытаюсь подключить i2c дисплей и амперковские часы реального времени
Заливаю код
PrimaryI2C.setup({sda: SDA, scl: SCL});
var lcd = require("HD44780").connectI2C(PrimaryI2C, 0x38);
PrimaryI2C.writeTo(0x38, 0x08);
var rtc = require('@amperka/rtc').connect(PrimaryI2C);
rtc.setTime();
var dht = require("DHT11").connect(P4);
var oneWire = new OneWire(P12);
var sensor = require("DS18B20").connect(oneWire);
var temp_air;
var vlaz_air;
rtc.setTime();
//lcd 48A?;59
lcd.write(0b101010, 1);
//@01>B0 48A?;5O
setInterval(function(){
var date = rtc.getTime();
var seconds = date.getSeconds(); // !5:C=4K
var minutes = date.getMinutes();
var temp_gnd = sensor.getTemp().toFixed(1);
//AG8BK20=85 0
dht.read(function(a){
temp_air = a.temp.toString();
vlaz_air = a.rh.toString();
});
var vlaz_gnd = analogRead(A0).toFixed(3) * 100;
lcd.setCursor(0, 0);
lcd.print("Temp_GND:" + temp_gnd + "\xB0" + "C");
lcd.setCursor(0, 1);
lcd.print("Temp_AIR:" + temp_air + "\xB0" + "C ");
lcd.setCursor(0, 2);
lcd.print("Hr_GND:" + vlaz_gnd + "%");
lcd.setCursor(0, 3);
lcd.print("Hr_AIR:" + vlaz_air + "%");
lcd.setCursor(12, 3);
lcd.print(minutes +':' + seconds);
}, 7000);
выдает ошибку
Uncaught InternalError: Timeout on I2C Write Transmit Mode 2
at line 1 col 52
...i2c.writeTo(this._address,t),this._i2c.readFrom(this._addres...
^
in function "read" called from line 1 col 20
var t=this.read(0,1)[0];t>>7&&this.write(0,128^t)
^
in function "start" called from line 1 col 133
...is._address=104,this.start()
^
in function "Rtc" called from line 1 col 10
new Rtc(t)
^
in function "connect" called from line 266 col 53
var rtc = require('@amperka/rtc').connect(PrimaryI2C);
^
Uncaught Error: Cannot read property 'setTime' of undefined
at line 267 col 4
rtc.setTime();
^
Я так понимаю ругается на адреса модулей
Подскажите, как правильно?