Tag Archives: python

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], [0,1,1,0], [0,0,1,0], [0,0,1,1], [0,0,0,1], [1,0,0,1] […]

PiWars2017 Also tagged , , Leave a comment

Moving Forwards

Our robot is alive and moving. At the heart of the Team Seaford robot control is the ServiceIo class. The ServiceIo class is responsible for controlling the four drive motors. Each motor is connected to a H bridge motor controller. The H bridge controllers require two inputs per motor. The inputs control the direction of […]

PiWars2017 Also tagged , , Leave a comment

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:      safechars = string.letters + […]

Python Also tagged Leave a comment