@Maria, could you specify what kind of flame sensor are you using? a link from the webshop you've bought would be the best. it has analog or digital output? because in the sketch you hooked up to a digital pin, i assume it has a digital output.
if digital, please confirm:
- it was correctly set the threshold value with the trimpot?
- on flame present, it has low or high output? (this should be in specification, or you can simply test with a multimeter)
with your current code, at least the buzzer sounds correctly on flame event? if not:
1) first you should write a minimalist, non blynk sketch, and test if it works correctly:
#define FLAME 2
#define BUZZER 13
// we should know the sensor output level on flame detection is low or high?
// if low: use INPUT_PULLUP
// if high: use INPUT + a phisical pulldown resistor, say 10k
// in the following sketch i will assume that the sensor has a low signal on flame detection and threshold is set correctly with trimpot
if (!digitalRead(FLAME)) digitalWrite(BUZZER, HIGH); // if sensor output is high, remove "!" from the if statement
else digitalWrite(BUZZER, LOW);
please confirm if this works correctly before going further!
2) in online mode, first of all, you have to be sure that you have a solid connection to blynk server, both on phone and mcu. (you can test this with sending just the mcu uptime in every second and see on a display widget in blynk app if increments regularly)
3) after all the above points are working reliable, you can implement the code for the flame sensor.