1 #ifndef TEST_STEPPER_MOTOR_H 2 #define TEST_STEPPER_MOTOR_H 13 #include "stepper_motor.h" 14 #include "../Arduino/arduino.h" 15 #include "../../Generics/generics.h" 17 void TestStepperMotor() {
19 std::cout <<
"Testing Stepper Motor." << std::endl;
22 std::shared_ptr<StepperMotor> stm23_ee = std::shared_ptr<StepperMotor>(
new StepperMotor( stepper.ip_addr,\
23 stepper.port_addr ) );
25 std::cout <<
"Tuning cavity by + 1 inch." << std::endl;
26 stm23_ee->TuneCavity( 1.0 );
30 std::cout <<
"Tuning cavity by - 1 inch." << std::endl;
31 stm23_ee->TuneCavity( -1.0 );
35 void TestStepperMotorWithArduino() {
37 std::cout <<
"Testing Stepper Motor and Arduino." << std::endl;
40 std::shared_ptr<Arduino> arduino = std::shared_ptr<Arduino>(
new Arduino( arduino_info.ip_addr,\
41 arduino_info.port_addr ) );
44 std::shared_ptr<StepperMotor> stm23_ee = std::shared_ptr<StepperMotor>(
new StepperMotor( stepper.ip_addr,\
45 stepper.port_addr ) );
47 const double starting_length = 6.0;
48 double cavity_length = arduino->GetCavityLength();
50 std::cout <<
"Setting cavity to length of " << starting_length <<
" Inches." << std::endl;
51 stm23_ee->TuneToLength( starting_length, cavity_length );
55 #endif // TEST_STEPPER_MOTOR_H Object to send and receive commands from an Arduino Uno (R3)
Definition: arduino.h:21
Definition: configprocessor.h:38
Object to sends commands to an Applied Motion products stepper motor.
Definition: stepper_motor.h:19