#include <iarduino_Pressure_BMP.h> iarduino_Pressure_BMP sensor(0x77); float x = 0; float t = 0; float bmppressure; float bmptemperature; float bmpaltitude; float bmppressure2; void setup() { Serial.begin(9600); sensor.begin(); } void loop() { if(sensor.read(1)){ bmppressure = sensor.pressure; bmptemperature = sensor.temperature; bmpaltitude = sensor.altitude; } if(sensor.read(2)){ bmppressure2 = sensor.pressure; x = bmppressure; } t = bmptemperature; Serial.println((String("D - ") + String(x) + String(" T - ") + String(t))); }
Открыть пример: Online ArduBlock
#include <iarduino_Pressure_BMP.h> iarduino_Pressure_BMP sensor(0x76); float x = 0; float t = 0; float bmppressure; float bmptemperature; float bmpaltitude; float bmppressure2; void setup() { Serial.begin(9600); sensor.begin(); } void loop() { if(sensor.read(1)){ bmppressure = sensor.pressure; bmptemperature = sensor.temperature; bmpaltitude = sensor.altitude; } if(sensor.read(2)){ bmppressure2 = sensor.pressure; x = bmppressure; } t = bmptemperature; Serial.println((String("D - ") + String(x) + String(" T - ") + String(t))); }
Открыть пример: Online ArduBlock
Видеоурок: