[SOLVED] Value display mismatch

Hi!, i’m sure that i’m doing something obviously wrong, but i am trying to send the value of a uint32_t variable from my Photon device to Blynk Cloud in order to visualize it by using the sentence Blynk.virtualWrite(V3, EEG0); , and, in addition i print the same value on a terminal. The problem is that the value visualized in Blynk using a Value display widget (for example 103694) is different from the one represented on the terminal (496395). the only way i can see both values are the same, is to use a terminal widget on blynk. What i’m doing wrong?. thanks

Hello. Probably sending different values. Posting code here will help.

… you will find part of the code below, with uint8_t *value. when i use a terminal widget on the blynk app, both values are the same, but in case i use, for example a value display widget, the represented values are different. Sotty in advance in case it is an evident error. thanks

uint32_t EEG0 = (value[4] + (value[5] << 8) + (value[6] << 16));
Serial.print("      > EEG0 = ");
Serial.println(EEG0);    
Blynk.virtualWrite(V3, EEG0);

So will you show us code that proves that or not?

Here you can see the results for using a terminal widget, where you can see that the last value is the same as the printed EEG0 value (393688).

Here you can see the results for using a value display widget, where you can see that printed value for EEG0 (656155) is different from the one visualized (136408).

Screenshots are 5 minutes apart. Put the 2 widgets in the same screen and do a single screenshot.

If you can’t show both widgets at the same time then we have no chance without seeing at least some of your code.

1 Like

Hi, i pushed the same value fom hardware to both virtual pins V3 and V4 in order to visualize them in a value display widget and a terminal widget. is that ok for you?

EEG0 = (value[4] + (value[5] << 8) + (value[6] << 16));
Serial.print("      > EEG0 = ");
Serial.println(EEG0);    
Blynk.virtualWrite(V3, EEG0);
Blynk.virtualWrite(V4, EEG0);

What value shows Serial.println(EEG0); and what corresponding value you get in app?

… the value shown by Serial.println(EEG0); is 191340, the same as the one displayed in the terminal widget, but different from the one shown in the Value display widget (41228)

@fbto I don’t see how this could be possible. Could you please post full sketch?

Hi @Dmitriy, i’ve reduced the code to leave just the excerpt related to the reported problem. I’ve checked that the behavioral is the same with it, so the value shown in the Terminal widget (linked to V4 on the code) is the right one (191340) but the value displayed on the Value Display widget (linked to V3 on the code) is different (41228).

#include "SparkCorePolledTimer/SparkCorePolledTimer.h" 
#include "blynk/blynk.h"

#define BLYNK_PRINT Serial
#define BLYNK_DEBUG

char auth[] = ""; // Put your token here
uint8_t value[] = {0x6c, 0xeb, 0x02};

SparkCorePolledTimer myTimer(5000);  

void setup()
{
  Serial.begin(9600);
  delay(5000);
  Serial.println("Start"); 
  Blynk.begin(auth);

  myTimer.SetCallback(sendUptime);
}

void sendUptime()
{
    
    uint32_t EEG0 = (value[0] + (value[1] << 8) + (value[2] << 16));
    Serial.println(EEG0);    
    Blynk.virtualWrite(V3, EEG0);
    Blynk.virtualWrite(V4, EEG0);
}

void loop()
{
  Blynk.run();
  myTimer.Update();
}

You probably enabled http://docs.blynk.cc/#widgets-common-widget-settings-data-mapping in that case. Please turn off it.

Hi @Dmitriy … you are right. sorry. now it works. thanks