Hard-fault using bmp280 and blynk

I wanted to use a BMP280 (Airpressure, Temperature) in Combination with Blynk to transfer that onto my Phone.
but everytime i try it it keeps Crashing (Red Blinking light) my Particle Photon

#include <Adafruit_BMP280.h>
#include <Adafruit_Sensor.h>
#include <blynk.h>

char auth[] = "9a1c4a91c88b413690ff1e409b090b60";

#define BMP_CS A0
#define BMP_SCK A1
#define BMP_MISO A2
#define BMP_MOSI A3 

void Enviro(void);

double AmbientPressure = 1013.25;
//Adafruit_BMP280 bmp; // I2C
//Adafruit_BMP280 bmp(BMP_CS); // hardware SPI
Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);

Timer timer(5000, Enviro);

// Update to reflect current pressure at sea level
//float seaLevelhPa = 1013.25;

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth);
  
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
  pinMode(A3, INPUT);

  timer.start();
}

BLYNK_WRITE(3)
{
    double AmbientPressure = param.asInt();
}

void Enviro()
{
    Blynk.virtualWrite(V0, double(bmp.readTemperature()));
}

void loop()
{   
    Blynk.run(); // All the Blynk Magic happens here...
}

@redinvader, I would not put a Blynk command in the timer callback. You need to treat it like an ISR. You can use a non-blocking millis() timer in loop instead which makes the Blynk call at the fixed intervals.

@peekay123 can you give me an example ? iam not that fit in all this

@redinvader, the idea is that the if() statement coupled with millis() creates a non-blocking timer (vs using delay() which blocks) which only runs code at fixed intervals. That way loop() runs freely, as does Blynk.run(). You can use non-blocking timers like this for any timed event you need. The timing is not necessarily accuate (to the exact millisecond) but it is good, reliable programming form.

unsigned long enviroTimer = 0;     // This must be a global variable

void loop()
{
    if (millis() - enviroTimer >= 5000) {
       Blynk.virtualWrite(V0, double(bmp.readTemperature()));
       enviroTimer = millis();
    }

    Blynk.run(); // All the Blynk Magic happens here...
}