Linear driver with st driver

Dependencies:   X_NUCLEO_IHM04A1

Dependents:   Basic_DC_Control Basic_DC_Control1 DC_Serial

Files at this revision

API Documentation at this revision

Comitter:
stebonicelli
Date:
Fri Jun 21 07:56:33 2019 +0000
Parent:
27:bf0109fb61c3
Commit message:
Revision and CleanUp

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Jun 21 07:43:15 2019 +0000
+++ b/main.cpp	Fri Jun 21 07:56:33 2019 +0000
@@ -27,28 +27,14 @@
 Thread canrxa;
 
 //Utility
-InterruptIn button(USER_BUTTON);
 DigitalOut led(LED1); //Change?
 
-
-void motor_error_handler(uint16_t error)
-{
-  printf("ERROR: Motor Runtime\n\r");
-  while(1){}; 
-}
-
 void motor_zero()
 {
   motor->run(0, BDCMotor::FWD);
   motor->run(1, BDCMotor::FWD);
 }
 
-void button_int_handler(unsigned int motorId)
-{
-    printf("MOTOR SPEED: %d\n\r", motor->get_speed(motorId)); 
-    motor_zero();
-}
-
 void my_error_handler(uint16_t error)
 {
   /* Backup error number */
@@ -154,7 +140,6 @@
   motor->attach_flag_interrupt(my_flag_irq_handler);
   motor->attach_error_handler(my_error_handler);
 
-  
   printf("DONE: Motor Init\n\r");
   
   // CAN Initialization