import GPIO import MOD import debug def radio_on_off(on_off): if (on_off == 'on'): debug.msg('Radio on') GPIO.setIOvalue(7, 0) MOD.sleep(3) elif (on_off == 'off'): debug.msg('Radio off') MOD.sleep(3) GPIO.setIOvalue(7, 1) def dit(): MOD.sleep(1) GPIO.setIOvalue(3, 1) MOD.sleep(1) GPIO.setIOvalue(3,0) def dash(): MOD.sleep(1) GPIO.setIOvalue(3, 1) MOD.sleep(3) GPIO.setIOvalue(3,0) def code(number): MOD.sleep(3) if (number == '.'): debug.msg('Dot') dit() dash() dit() dash() dit() dash() elif (number == 'N'): debug.msg('N') elif (number == 'S'): debug.msg('S') elif (number == 'E'): debug.msg('E') elif (number == 'W'): debug.msg('W') elif (number == '-'): debug.msg('-') dash() dit() dit() dit() dit() dash() else: int_number = int(number) debug.msg('%d' % int_number) if (int_number == 0): dash() dash() dash() dash() dash() elif (int_number == 1): dit() dash() dash() dash() dash() elif (int_number == 2): dit() dit() dash() dash() dash() elif (int_number == 3): dit() dit() dit() dash() dash() elif (int_number == 4): dit() dit() dit() dit() dash() elif (int_number == 5): dit() dit() dit() dit() dit() elif (int_number == 6): dash() dit() dit() dit() dit() elif (int_number == 7): dash() dash() dit() dit() dit() elif (int_number == 8): dash() dash() dash() dit() dit() elif (int_number == 9): dash() dash() dash() dash() dit() else: debug.msg('Not between 0 and 9') def splitter(coord): debug.msg(coord) j = 0 while j < len(coord): code(coord[j]) j = j + 1