simple question on serial terminals
sticktrader
Posts: 15
I have a quick question about decimal numbers being transfered serially.· If I use the "Parallax Serial Terminal" spin code and I use the "Float 32" spin code and I want to add to decimal numbers together.· The numbers being decimal fractions like 5.5 and 2.5, how do I get it to do it by changing the above numbers into floating point numbers.· When I try to use DecIn it changes the numbers into intergers and ignores the decimal place.· I am assuming I make them a string and send them to the program but then I cannot add them without changing them into a floating point number somehow.
Thanks
Thanks
Comments
So if your numbers are not too big - simply multiply them with 10 or 100 or how many digits you have after the fractionpoint and then simply add the integervalues
in your example above this would mean
5.5 * 10 = 55
2.5 * 10 = 25
55 + 25 = 70
If this solution does not work you have to provide more information about your project that the forum-members know
the limitations of your project
best regards
Stefan
Thanks