![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
pachas
Dependencies: mbed QEI FastPWM
main.cpp
- Committer:
- miguelangel_2511
- Date:
- 2020-04-19
- Revision:
- 5:bd5fc0510e7b
- Parent:
- 3:45299e7882b9
- Child:
- 6:d38287621cca
File content as of revision 5:bd5fc0510e7b:
#include "mbed.h" #include "stdint.h" #include "project_defines.h" #include "buttons.h" #include "encoder_interface.h" #include "tft_interface.h" #include "stepper_motor_driver.h" #include "ventilator.h" // ****************************** // OBJECT CONSTRUCTION // ****************************** Ticker ticker_int_10us; // Ticker interrupt // ****************************** // GLOBAL VARIABLES // ****************************** // ****************************** // FUNCTION DECLARATION // ****************************** void Ticker_ISR(void); // ISR that is called when the timer reaches the set value int main(void) { Buttons_Initialize(); ticker_int_10us.attach(&Ticker_ISR, 0.01); TFT_Interface_Initialize(); Stepper_Driver_Init(); //Stepper_Calculate_Period_Ramp(); while(1){ Stepper_Driver_State_Machine(); TFT_Encoder_Interaction(); } return 0; } // Ticker Interrupt Service Routine void Ticker_ISR(void){ static uint8_t conta_10ms = 0; Button_Debounce(); conta_10ms++; if(conta_10ms == 2){ conta_10ms = 0; Encoder_Read(); } }