[chirp_devel] Need help with UV-5R reading/writing

Les Niles
Sun Jan 13 15:04:40 PST 2013


If STEP_LIST is a sequence of the radio memory values 0x0, 0x10, 0x20, etc., then
	map(lambda x: x/16, STEP_LIST)
will return a sequence [0, 1, 2, …]
Is that what you're looking for?

  -Les


On 13 Jan 2013, at 6:29, Jim Unroe <rock.unroe at gmail.com> wrote:
> 
> On Sat, Jan 12, 2013 at 8:38 PM, Andrew Errington <erringtona at gmail.com> wrote:
> 
> 
> What do you need to do?  If you are writing software and you need to convert
> 0, 1, 2, 3 ... 14 to 0x00, 0x10, 0x20, 0x30 ... 0xE0 then just multiply by
> 16.
> 
> 0 x 16 = 0 = 0x00
> 1 x 16 = 16 = 0x10
> 2 x 16 = 32 = 0x20
> 3 x 16 = 48 = 0x30
> .
> .
> .
> 14 x 16 = 224 = 0xE0
> 
> Is that what you need to do, or do I misunderstand your question?
> 
> Andrew,
> 
> I want to use this in a scenario similar to this to create a menu setting item for 'step'
> 
>             rs = RadioSetting("vfoa.step", "VFO A Tuning Step",
>                               RadioSettingValueList(STEP_LIST,
>                                                     STEP_LIST[self._memobj.vfoa.step]))
>             vfopresets.append(rs)
> 
> The structure 'vfoa' has 'step' in it but the above doesn't work (out of range) because of the difference between the 0, 1, 2, 3 ... 14 vs. the 0x00, 0x01, 0x02, 0x03 ... 0xE0 (or 0, 16, 32, 48 ... 224).
> 
> This is probably simple to implement but right now I can't see the forest for the trees.
> 
> 73,
> Jim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20130113/5cf64cf1/attachment-0001.html 


More information about the chirp_devel mailing list