I need some help with this apparently simple problem.
I own a BMP280 coming from a No-Name-Chinese company. It works pretty well, so I wanted to store some measured values for 20 minutes in the RAM and then connect the Arduino to a PC and read the values. Because the RAM of my Arduino Nano Every is not gigantic, I decided to truncate the numbers after the decimal point of the output of the bmp.readPressure() function. But- SURPRISE! The output was -as an example- not 123 but 123.00. I tried to save it then as an integer but it didnt worked.How to get rid of these numbers???
Thanks a million. I have been working on this problem for 3 weeks (my own problem solving creativity is non-existent), now I have solved it. I will turn ahead to face the next problem😉.
I am facing an endless series of problems right now. The idea is seemingly simple. You have a BMP280 and an Arduino Nano Every. The Arduino stores the print in its RAM and at the end I come and read the data from the serial port. But the point is the storage. The output of the bmp.readPressure() function returns only a float. So I decided to truncate the numbers after the decimal point and store only the Pascal number. But yeah, that's the problem. The Arduino just won't let go of those numbers. Even if you use trunc(), the output looks something like this: trunc(5.25)=5.00. And if you do it that way with (int), you get a ridiculous number, something like this: (int) 1005.56=3467. So yes, that is the point. How can I do a workaround?
Your two topics on the same or similar subject have been merged.
Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.
Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.
Repeated duplicate posting could result in a temporary or permanent ban from the forum.
Could you take a few moments to Learn How To Use The Forum
It will help you get the best out of the forum in the future.