A program to automatically tune a guitar. Written by Justin Reidhead and Steven Swenson
Dependencies: FFT FrequencyFinder Motor NewTextLCD PinDetect mbed strings
Diff: Motor/Motor.cpp
- Revision:
- 15:bb2bc286f44b
- Parent:
- 14:fd59e7acf2e5
--- a/Motor/Motor.cpp Thu Apr 26 22:20:53 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -#include "Motor.h" - -Motor::Motor(PinName enable,PinName direction,PinName step) : _enable(enable), _direction(direction), _step(step) { -_enable=1; -} - -Motor::~Motor() { -} - -void Motor::motor_turn(int direction, int steps) { - _enable=0; - float freq=600;//frequency of PWM signal to drive stepper motor - _step.period(1/freq); - _step.write(.5); - _direction=direction; - wait(steps*(1/freq)); - _step.write(0); - _enable=1; -} \ No newline at end of file