I have an Arduino reason that I'm actually doing a lot of clean stuff in which I I am reading a fluorescent and it is about to be flushing towards a barrier because it is a hall sensor device. The problem I am facing is that my mathematical collection is based on a second value of data. , When i turn the gap And sleeps for the other then calculating for the flow in GP / M does a great job. For my purposes though I can not stop and collect data, so instead of changing the time of more than one thousand milliseconds Let's count. So I take the amount of time passed through the last loop, it goes up to 1000 milliseconds or 1 second, then I have a percent of the second second stored in the variable, I multiply the count by percentage and I'm more than that number Number should come in second. It is still a growing number of results that I can zero the numbers before the next loop. Below I included the way to format expressions and loop code for the flosener, I was posting the whole code but I do not have to waste the space on stackshowforflow and I know that that part of the code is already in the sleep method Works with
Longer Current Mills = 0; Long last = 0; Intchmilis = 0; Volatile Difference NbTopsFan; // measuring the new mounting edges of the signal int; Float the real NBITSFran; Float real milliseconds; Float Calc; Float the caled; Int Calf; Int Holenor = 7; Zero loop () {if (lastMillis = 0) {lastMillis = millis (); } CurrentMillis = Mills (); Czech millis = (current millis - last miis); If (checkmills = 1000) {realMillis = (Check Millise / 1000); RealNbTopsFan = (NbTopsFan * realMillis); NewNbTopsFan = realNbTopsFan; Calc = (Newbitsfans * 60 / 7.5); // (pulse frequency x 60) / 7.5 q, = flow rate calc = (calc / 60); Calc = (Calc / 3.78541); Calc = (calc * 1.47); Caked = (Calc * 100); Calcf = Calcd; NbTopsFan = 0; Last millisecondos = 0; Check millise = 0; RealMillis = 0; RealNbTopsFan = 0; NewNbTopsFan = 0; }}
Your first line should be read:
< Code> if (last Mallis == 0) {last Mallis = mills (); }
You need double = to evaluate the variable
Comments
Post a Comment