Hi, i have a stream of data receiving from serial port (Arduino), and want to convert this stream of data to flaot numbers, but i faced NaN problem and tried to solve it in several ways but no update, i hope you can help me to know where's my misstake and how to solve it. below is my code and then the result.
Thanks alot
import processing.serial.*;
import java.text.*;
import java.util.*;
PrintWriter output;
DateFormat fnameFormat= new SimpleDateFormat("yyyyMMdd");
String fileName;
Serial myPort;
short portIndex = 0;
float floatvalue;
String stringvalue;
void setup()
{
size(200, 200);
// Open whatever serial port is connected to Arduino.
String portName = Serial.list()[portIndex];
println(Serial.list());
println(" Connecting to -> " + Serial.list()[portIndex]);
println(portName);
myPort = new Serial(this, portName, 9600);
Date now = new Date();
fileName = fnameFormat.format(now);
println(fileName);
output = createWriter(fileName+".txt"); // save the file in the sketch folder