A program to automatically tune a guitar. Written by Justin Reidhead and Steven Swenson

Dependencies:   FFT FrequencyFinder Motor NewTextLCD PinDetect mbed strings

Committer:
melangeaddict
Date:
Fri Apr 20 21:27:55 2012 +0000
Revision:
8:651fbf5ae98a
Parent:
5:c0fd99f07536
3:30 april 20;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
melangeaddict 2:9c0a83c5ded5 1 #include "Motor.h"
melangeaddict 2:9c0a83c5ded5 2
melangeaddict 2:9c0a83c5ded5 3 Motor::Motor(PinName enable,PinName direction,PinName step) : _enable(enable), _direction(direction), _step(step) {
melangeaddict 5:c0fd99f07536 4 _enable=1;
melangeaddict 2:9c0a83c5ded5 5 }
melangeaddict 2:9c0a83c5ded5 6
melangeaddict 2:9c0a83c5ded5 7 Motor::~Motor() {
melangeaddict 2:9c0a83c5ded5 8 }
melangeaddict 2:9c0a83c5ded5 9
melangeaddict 2:9c0a83c5ded5 10 void Motor::motor_turn(int direction, int steps) {
melangeaddict 2:9c0a83c5ded5 11 _enable=0;
melangeaddict 8:651fbf5ae98a 12 float freq=600;//frequency of PWM signal to drive stepper motor
melangeaddict 2:9c0a83c5ded5 13 _step.period(1/freq);
melangeaddict 2:9c0a83c5ded5 14 _step.write(.5);
melangeaddict 2:9c0a83c5ded5 15 _direction=direction;
melangeaddict 2:9c0a83c5ded5 16 wait(steps*(1/freq));
melangeaddict 2:9c0a83c5ded5 17 _step.write(0);
melangeaddict 2:9c0a83c5ded5 18 _enable=1;
melangeaddict 2:9c0a83c5ded5 19 }