Hi Rob,
I wanted to suggest to name the functions after the return data type. I never 
use floats, so if I would have a function called "fine", it would return a 
length in mm (metric) or mils (=1/1000 inch imperial)
Even if you would return a length in micrometers, a dword would suffice for a 
range of over 4 kilometers, still by a smaller overhead than using a float.
Greets,Kiste
    Am Samstag, 30. September 2023 um 11:11:37 MESZ hat Rob CJ 
<[email protected]> Folgendes geschrieben:  
 
 Hi Vasile,
Thanks 🙂
I just came up with another idea. Using a float value makes the library big in 
ROM size (it easily adds 600 byte of ROM or more) and I only need one decimal.
So I have another idea and that is return the distance in mm. In that case I 
only need a word as return value.
So now I have only two functions:function 
hcsr04_get_distance_mili_meter()return word isfunction 
hcsr04_get_distance_mili_inch()return word is
I only do not know if mili-inch is an English term. Would like to know that.
Or should I use tens_of_cm and tens_of_inch?
Thanks.
Kind regards,
Rob
Van: [email protected] <[email protected]> namens vasi vasi 
<[email protected]>
Verzonden: zaterdag 30 september 2023 10:51
Aan: [email protected] <[email protected]>
Onderwerp: Re: [jallib] English (function) question For a non-native English 
speaker like me, the function names are perfect!
On Sat, Sep 30, 2023 at 11:40 AM [email protected] <[email protected]> wrote:

Hi all.
I have a question for English native speakers. I am working on a library for 
the HC-SR04 ultrasonic ranging module.
I have functions that return the distance in cm and inch.
My question is the following. One of the functions returns a word so the 
distance is without a decimal, so 2 cm, 5 inch, etc. The other function returns 
a float so the distance is with a decimal, so 3.5 cm, 5.1 inch.
I am looking for a good name for these functions. I now have the following 
names but I am wondering if there is a better name for them:
function hcsr04_get_distance_cm_coarse()return word isfunction 
hcsr04_get_distance_inch_coarse()return word isfunction 
hcsr04_get_distance_cm_fine()return float isfunction 
hcsr04_get_distance_inch_fine()return float is
So I am looking for  a better name for these functions. Any suggestions? 
Thanks.
Kind regards,
Rob




-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
[email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/655e1cd1-adaf-49d9-b645-9ddcef475248n%40googlegroups.com.



-- 
Vasi

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
[email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/CABsDq%3D86Jh5W8jHyb8VdQvvOJbrin%2BEzLTHKnkOsfzbLsR7-XQ%40mail.gmail.com.


-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/GVXP195MB163796241C555E0C1AB38BDBE6C7A%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM.
  

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/1217217500.4864974.1696065700920%40mail.yahoo.com.

Reply via email to