Maybe I'm missing something. If the user has to enter the frequency as a floating point number, how does storing it as an integer help? When the user's input is changed to and saved as in integer, wouldn't the same error occur?<br>
Jim<br><br><div class="gmail_quote">On Mon, Jan 28, 2013 at 11:24 AM, Andrew Errington <span dir="ltr"><<a href="mailto:erringtona@gmail.com" target="_blank">erringtona@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, 28 Jan 2013 19:33:44 Jim Unroe wrote:<br>
</div><div class="im">> I'm don't believe I understand what "try with integers" means.<br>
><br>
> Here's the portion of code that I think the problem is in. More<br>
> specifically the 'def convert_freq_to_bytes(real_freq) part.<br>
><br>
> + def convert_bytes_to_freq(bytes):<br>
> + real_freq = 0<br>
> + for byte in bytes:<br>
> + real_freq = (real_freq * 10) + byte<br>
> + return real_freq / 100000.0<br>
> +<br>
> + def convert_freq_to_bytes(real_freq):<br>
> + bytes = [ 0 for x in range(0,8) ] # init list with 8 times 0<br>
> + real_freq = int(freq * 100000) # it has to be integer<br>
<br>
</div> ^^^^<br>
Don't you mean "real_freq" here, not "freq"?<br>
<br>
73,<br>
<br>
Andrew<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
chirp_devel mailing list<br>
<a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a><br>
<a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>
Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br>
</div></div></blockquote></div><br>