Testing 1 blue pill
Dependencies: mbed mbed-rtos TextLCD
Diff: Interface/Interface.cpp
- Revision:
- 21:6d9f6a986647
- Parent:
- 18:3523660f3930
- Child:
- 23:07a368f2cdb1
--- a/Interface/Interface.cpp Tue Feb 12 17:09:27 2019 +0000 +++ b/Interface/Interface.cpp Thu Feb 14 10:22:54 2019 +0000 @@ -66,6 +66,7 @@ { if (_Select == false)//Select = 0 { + if (_Loop > 0) { _Loop = _Loop - 1; @@ -130,6 +131,16 @@ void INTERFACE::Select()//Select Routine { _Select = !_Select;//Toggle select to choose between two options e.g. Duty cycle and loops as only two options are avalible + if(_Select == false) + { + Led_Select_Left = 1; + Led_Select_Right= 0; + } + else + { + Led_Select_Left = 0; + Led_Select_Right= 1; + } //Output to leds here dependant upon the select value e.g. 0 is left led and 1 is right led } void INTERFACE::Interface_main()//Main Routine to execute commands when the start button has been pressed @@ -138,16 +149,19 @@ { if (_Twist_Go == true) { + Led_Power = 1; //printf("20 Turns\n"); //STEPPER_MOTOR_1.Rotate_Steps(22); STEPPER_MOTOR_1.Rotate_Steps(_Turns_Todo);//Rotates for the specified number of steps given _Twist_Go = false; + Led_Power = 0; } } else if (_Function == 1) //Annealing Code { if (_Anneal_Go == true) { + Led_Power = 1; for ( int counter = 0; counter < _Loop; counter++) //Loop value, check if works { Tendon_Power.period(0.01); // set PWM period to 10 ms don't use pwm have this just to declare @@ -157,17 +171,20 @@ wait(6);//Fixed off time } _Anneal_Go = false; + Led_Power = 0; } } else if (_Function == 2) //Testing Code { if (_Test_Go == true) { + Led_Power = 1; Tendon_Power.period(0.01); // set PWM period to 10 ms don't use pwm have this just to declare Tendon_Power= _Duty_Cycle / 100; // set duty cycle to variable input from buttons between 0-1 (on lcd this is a percentage) also increment by values of 10 wait(_Power_Time);//Variable on time for power on Tendon_Power=0; // set duty cycle to 0% and power off _Test_Go = false; + Led_Power = 0; } } }