Thanks Les and Marc0,<br><br>I tried this quickly before work and ran into this problem<br>"NameError: global name 'convert_freq_to_bytes' is not defined"<br><br>I study some other drivers after work to see if I can find something similar to mimic. Here is how I am trying to use it just in case you can spot what I am doing wrong.<br>
<br>I've added 2 "elif" bits of code to the set_settings procedure<br><br> def set_settings(self, settings):<br> _settings = self._memobj.settings[0]<br> for element in settings:<br> if not isinstance(element, RadioSetting):<br>
self.set_settings(element)<br> continue<br> elif element.get_name() == "vfoa.freq":<br> convert_freq_to_bytes(self._memobj.vfoa.freq, element.value)<br> elif element.get_name() == "vfob.freq":<br>
convert_freq_to_bytes(self._memobj.vfob.freq, element.value)<br> try:<br><br>Then I placed the following just ahead of my menu item<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> for i in range(7, -1, -1): # go from 7 to 0<br> bytes[i] = real_freq%10 # extract last digit<br> real_freq /= 10 # throw away last digit<br>
return bytes<br><br>When I got the "not defined" error, I moved it above "def set_settings(self, settings):" but got the same "not defined".<br><br>Jim<br>