#include <Arduino.h>
#include <TM1637Display.h>
//#include <Wire.h>
//#include <BMx280I2C.h>
//#define I2C_ADDRESS 0x76
//BMx280I2C bmx280(I2C_ADDRESS);
// Module connection pins (Digital Pins)
#define CLK 3
#define DIO 4
float pres;
int prex;
// The amount of time (in milliseconds) between tests
#define TEST_DELAY 1000
TM1637Display display(CLK, DIO);
void setup()
{
uint8_t data[] = { 0xff, 0xff, 0xff, 0xff };
uint8_t blank[] = { 0x00, 0x00, 0x00, 0x00 };
display.setBrightness(0x0f);
// All segments on
display.setSegments(data);
delay(TEST_DELAY);
display.clear();
// PER TEST
pres = 0.900 ;
//Wire.begin();
//bmx280.begin();
//bmx280.resetToDefaults();
//bmx280.writeOversamplingPressure(BMx280MI::OSRS_P_x16);
}
void loop()
{
//bmx280.measure();
//do {
// delay(100);
//} while (!bmx280.hasValue());
//pres = bmx280.getPressure();
prex = int(pres * 1000);
display.showNumberDec(prex, true);
delay(TEST_DELAY);
// PER TEST
pres += 0.001;
}