v2.9
This commit is contained in:
@ -34,23 +34,36 @@ void slave::init(int8_t MY485PORT_RX,int8_t MY485PORT_TX){
|
||||
|
||||
// GPSSeiral.begin(115200, SWSERIAL_8N1, 2, 12, false);
|
||||
wireme.setPins(7,8);
|
||||
|
||||
wireme.begin();
|
||||
Serial.println("slave init ...");
|
||||
if (!mlx.begin(MLX90614_I2CADDR,&wireme)) {
|
||||
Serial.println("Error connecting to MLX sensor. Check wiring.");
|
||||
//while (1);
|
||||
return ;
|
||||
};
|
||||
mlx.writeEmissivity(new_emissivity); // this does the 0x0000 erase write
|
||||
isinit=true;
|
||||
|
||||
mlx.writeEmissivity(new_emissivity);
|
||||
|
||||
Serial.println(sizeof(openGNRMC));
|
||||
|
||||
|
||||
}
|
||||
|
||||
double slave::getMLX(){
|
||||
if (/* condition */!isinit)
|
||||
{
|
||||
return 0;
|
||||
/* code */
|
||||
}
|
||||
|
||||
double a =mlx.readObjectTempC();
|
||||
return a;
|
||||
// Serial.write((char*) &a,8);
|
||||
}
|
||||
|
||||
void slave::getWehter(){
|
||||
|
||||
while (my485Port->read()!=-1);
|
||||
my485Port->write(a,8);
|
||||
delay(90);
|
||||
@ -89,6 +102,7 @@ float slave::getYuliang(){
|
||||
}
|
||||
|
||||
int32_t slave::getYuliangfuliang(){
|
||||
|
||||
while (my485Port->read()!=-1);
|
||||
my485Port->write(yuliangfuliangdu,8);
|
||||
delay(90);
|
||||
@ -107,6 +121,7 @@ int32_t slave::getYuliangfuliang(){
|
||||
|
||||
/// 返回1,表示ok
|
||||
uint8_t slave::claeryuliang(){
|
||||
|
||||
while (my485Port->read()!=-1);
|
||||
my485Port->write(ClearYL,8);
|
||||
delay(90);
|
||||
|
||||
Reference in New Issue
Block a user