Tag Archives: python

Stepper Motor Control Service

      No Comments on Stepper Motor Control Service

Today I have been busy developing a stepper motor service class. The service class will allow the Team Seaford robot to play crazy golf. import RPi.GPIO as GPIO import time class ServiceStepMotor: PinPhase1 = 14 PinPhase2 = 15 PinPhase3 = 17 PinPhase4 = 16 Steps = [ [1,0,0,0], [1,1,0,0], [0,1,0,0],… Read more »

Generate safe filenames using Python

      No Comments on Generate safe filenames using Python

This function removes illegal  characters to create file names that are safe to use on most operating systems. import string ## Make a file name that only contains safe charaters # @param inputFilename A filename containing illegal characters # @return A filename containing only safe characters def makeSafeFilename(inputFilename):     try:… Read more »