Download Print this page

Waveshare Motor Driver HAT User Manual page 12

Advertisement

Motor Driver HAT
This project has Exception Handling. Generally, motor keeps moving even you stop
project. value of control register doesn't be clean even you use CTRL+c to stop code.
signal(SIGINT, Handler);
single is signal handling function of linux system. SIGINT signal generates when
CTRL+c is executed to stop process, then Handler() function will run. In this function,
motors are stopped
Motor_Stop(MOTORA);
Motor_Stop(MOTORB);
DEV_ModuleExit();
exit(0);
USING
Demo code you download has no executable file moto, you need to run
generate it then execute command ./motor to run the demo code.
If you modify or add any functions, you need to run
If you change values of heard files, command make clear is also need before
12 / 16
make
again to update
make
to
make.

Advertisement

loading