We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm communicating with a microcontroller using the serial port using a demo I found and it works great. The issue is I do not want a floating point number to go to the microcontroller. Right now it does, using the code below.
What I would like to do is drop the decimal (or round off) "subtext[counter]" before sending via myPort.write. I have tried converting it to an int, but then myport.write doesn't like it. If there is a way to send an INT via myPort.write that would also be a good solution.
pan = Float.valueOf(subtext[counter]);
pan = (pan + 0.01) * 11.2;
(subtext[counter]) = Float.toString(pan);