blynkkk / blynk-library

Blynk library for IoT boards. Works with Arduino, ESP32, ESP8266, Raspberry Pi, Particle, ARM Mbed, etc.
https://blynk.io
MIT License
3.81k stars 1.38k forks source link

Arduino MKR1400 over USB -> float numbers are not transmitted #453

Closed StefanOelsner closed 3 years ago

StefanOelsner commented 5 years ago

Hi guys,

I'm having a problem with the Blynk-App on IOS with the Arduino MKR1400 over USB connection.

Blynk library version: [v0.6.1] IDE: [Arduino.] IDE version: [web based IDE] Board type: [MKR GSM 1400] Additional modules: [transmission over USB, not GSM]

Scenario, steps to reproduce

[Sending float numbers from Arduino to Value Display on specified virtual pin.]

Expected Result

[Seeing the float number in the Value display.]

Actual Result

[No data is displayed. When I change the value to integer typ, the value is transmitted. The exact same code works with float numbers when an Arduino UNO is used instead of an mkr 1400 that is samd based.]

Here is the simple code:

`

#include <BlynkSimpleStream.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "...";

BlynkTimer timer;
float duration;

// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, duration);
}

void setup()
{
  // Debug console

  // Blynk will work through Serial
  // Do not read or write this serial manually in your sketch
  Serial.begin(9600);
  Blynk.begin(Serial, auth);

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);

  delay(2000);
}

void loop()
{
  Blynk.run();
  timer.run(); // Initiates BlynkTimer
  duration = 10.99;
}

`

vshymanskyy commented 3 years ago

Should be fixed now