Maybe I&#39;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&#39;s input is changed to and saved as in integer, wouldn&#39;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">&lt;<a href="mailto:erringtona@gmail.com" target="_blank">erringtona@gmail.com</a>&gt;</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">&gt; I&#39;m don&#39;t believe I understand what &quot;try with integers&quot; means.<br>
&gt;<br>
&gt; Here&#39;s the portion of code that I think the problem is in. More<br>
&gt; specifically the &#39;def convert_freq_to_bytes(real_freq) part.<br>
&gt;<br>
&gt; +        def convert_bytes_to_freq(bytes):<br>
&gt; +           real_freq = 0<br>
&gt; +           for byte in bytes:<br>
&gt; +               real_freq = (real_freq * 10) + byte<br>
&gt; +           return real_freq / 100000.0<br>
&gt; +<br>
&gt; +        def convert_freq_to_bytes(real_freq):<br>
&gt; +            bytes = [ 0 for x in range(0,8) ]   # init list with 8 times 0<br>
&gt; +            real_freq = int(freq * 100000)      # it has to be integer<br>
<br>
</div>                               ^^^^<br>
Don&#39;t you mean &quot;real_freq&quot; here, not &quot;freq&quot;?<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>