Skip to main content

Posts

Showing posts from December, 2011

Tkinter GUI for Morse program

# Simple Tkinter GUI for G4AKW Morse Program # Geoff Robinson Dec 2011 # Version 1.1 from Tkinter import * ''' This differs from the traditional import statement in that it puts everything in the module into the default namespace of this program, so now rather than needing to refer to a textbox as Tkinter.Textbox we can just write Textbox ''' import tkSimpleDialog as tks import tkMessageBox root = Tk() # window geometry is width x height + x_offset + y_offset root.geometry("600x160+350+300") root.title('G4AKW Morse Program') Label(root, text='Enter code to send in box').pack(pady=10) # Left frame to hold buttons left = Frame(root) left.pack(side=LEFT, expand=True, fill=Y) # Right frame to hold display right = Frame(root, height=100, width=300, bd=3, relief=GROOVE) right.pack(expand=True, fill=BOTH) # change the colour of the right-hand frame def changeColour(c):     def change():         right.confi...

Python Morse Code Generator

  #!/usr/bin/python """ Morse Code Generator. Geoff Robinson, G4AKW, Version 1.0, 4th December 2011. Requirements: Python 2.7, Linux OS, alsaaudio. Usage # python mainmorse.py The basic element of Morse code is the dot and all other elements can be defined in terms of multiples of the dot length. The word PARIS is used because this is the length of a typical word in English plain text, it has a total length of 50 dot lengths. If the word PARIS is sent ten times in a minute using normal Morse code timing then the code speed is 10 WPM. There are 500 dot lengths in a minute for 10 wpm or 1000 dot lengths per min for 20 wpm. The dot length is therefore 60mS for 20 wpm. The python dictionary 'code' and the function convert() converts characters to their dot space equivalents i.e either on or off keying. """ import serial import time, thread import random import sys import sched import wave, struct, math from alsaaudio import * impor...