Generic Step Motor WebInterface - control a step motor using a Pololu A4983 driver from a webinterface (EXPERIMENTAL PROTOTYPE - just to be used as a proof-of-concept for a IoT talk, will not be updating this code so often)
Dependencies: EthernetNetIf RPCInterface mbed HTTPServer
A4983.h
00001 //--------------------------------------------------------------------------------------------- 00002 // Class to interface Pololu A4983 Stepper Motor Driver 00003 // http://www.coolcomponents.co.uk/catalog/product_info.php?products_id=358¤cy=EUR 00004 // https://www.pololu.com/file/download/a4983_DMOS_microstepping_driver_with_translator.pdf?file_id=0J199 00005 //--------------------------------------------------------------------------------------------- 00006 class A4983 00007 { 00008 //------------------------------------------------------------------------------------------- 00009 private: 00010 //------------------------------------------------------------------------------------------- 00011 00012 //------------------------------------------------------------------------------------------- 00013 public: 00014 //------------------------------------------------------------------------------------------- 00015 uint8_t f_motor_enable; // flag to Enable/Disable Step Motor, 0 => Disable, 1 => Enable 00016 uint8_t f_motor_direction; // flag for the Step Motor direction, 0 => Normal, 1 => Inverted 00017 float k_delay; // delay constant in seconds (Step Motor Speed) [0.0001;0.000025] 00018 //------------------------------------------------------------------------------------------- 00019 A4983(); 00020 00021 void adjust_microstepping_mode(uint8_t factor); 00022 void singlestep(); 00023 void sleep(bool value); 00024 void looprun(); 00025 void loopstart(); 00026 void loopstop(); 00027 }; 00028 //---------------------------------------------------------------------------------------------
Generated on Wed Jul 13 2022 06:36:07 by 1.7.2