History Graph No Data

Hey there. I am trying to send data to histogram when a button is pushed.

I am using attachInterrupt, Here is part of the code
#define historyPin V5

// Attach INT to our handler
 attachInterrupt(digitalPinToInterrupt(confirmPin), confirm, CHANGE);

void confirm()
{
  // Invert state, since button is "Active LOW"
  if (digitalRead(confirmPin)) {
   
    
  } else {
   
  
  Blynk.virtualWrite(historyPin, value);

  }
}

However, when I push the button, the history graph keeps saying no data. Any clue?
I am running sketch on esp8266, connected to home WIFI, ios 9.2 on iphone. I can get connected to esp running the sketch since i can use a button widget to toggle LED on/off.

Hello, what do you send with value?

hi, thanks for quick response. so, i created a variable using
double value = 5.0;
i have two other interrupt buttons, one that increments the value and the other decreases it. on pressing confirm button, I wish to push the value set by user to the history graph.

Maybe the problem is that 1h/6h graph has a 1 minute delay?

shouldnt there be at least one data point? the widget shows nothing! that’s weird

Are you sure virtualWrite is really happening?

how to confirm? i am using virtual write with this widget only.

Try to add one more widget on same pin.

yep. its not happening. i changed to value display or graph and still nothing… its there anything wrong with the code? can i trigger this using interrupt button without BLYNK_READ function?

Please post full code.

#include <Wire.h>
#include "rgb_lcd.h"
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#define upPin 12
#define downPin 13
#define confirmPin 16
#define historyPin V5


rgb_lcd lcd;

const int colorR = 255;
const int colorG = 255;
const int colorB = 0;
double glu = 5.0;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "1bf9f0XXXXXXXXfXXXaa7XXXXX38";

void setup() 
{
    // set up the LCD's number of columns and rows:
    lcd.begin(16, 2);
    
    lcd.setRGB(colorR, colorG, colorB);
     lcd.print("Glucose");
   // Make pin 2 HIGH by default
  pinMode(upPin, INPUT_PULLUP);
  // Attach INT to our handler
  attachInterrupt(digitalPinToInterrupt(upPin),checkUp, FALLING);
  pinMode(downPin, INPUT_PULLUP);
  // Attach INT to our handler
  attachInterrupt(digitalPinToInterrupt(downPin), checkDown, FALLING);
  pinMode(confirmPin, INPUT_PULLUP);
  // Attach INT to our handler
  attachInterrupt(digitalPinToInterrupt(confirmPin), confirm, CHANGE);
 Blynk.begin(auth, "TP-LINXX54", "XXXXX"); 
 while (Blynk.connect() == false) {
     // Wait until connected    }
 }
     
     
}


void checkUp()
{
  // Invert state, since button is "Active LOW"
  if (digitalRead(upPin)) {
    
  } else {
   
    glu+=0.1;
  }
}

void checkDown()
{
  // Invert state, since button is "Active LOW"
  if (digitalRead(downPin)) {
    
  } else {
   
    glu-=0.1;
  }
}

void confirm()
{
  // Invert state, since button is "Active LOW"
  if (digitalRead(confirmPin)) {
   
    
  } else {
   
  
  Blynk.virtualWrite(historyPin, glu);

  }
}



void loop() 
{
  Blynk.run();
      
  lcd.setCursor(0, 1);
  lcd.print(glu);
  lcd.print(" mmol/L");
    
}

any help? i still cannot get the widget to work

Hi. Sorry for delay, was busy. Code seems fine for me, nothing strange. Was you able to figure out problem by yourself?

nope. still doesnt work. i have tried a lot of options. even vpn, given that im in mainland china. tried iphone settings also, nothing seems to work. it’s a bit strange

Ok, could you please put some serial output in

So we can make sure method is called and expected Blynk function is called also.