int _main() { mPlay(&tune); while (1) { mGetData(&lastplayed,1,500); printf("channel: %d, note: %d, velocity: %d\n",lastplayed.chan,lastplayed.note,lastplayed.vel); Sleep(100); if (GetAsyncKeyState(VK_ESCAPE)) { mStop(); ExitProcess(0); } } }
/* Switch to the constant voltage between 2.5V~3V * and keep motor in idle state (STATIC/STOP)*/ void mSwitchOFF(){ GPIO_WriteBit(MOTOR_PWM_PORT, MOTOR_LEFT_SW_PIN, Bit_RESET); GPIO_WriteBit(MOTOR_PWM_PORT, MOTOR_RIGHT_SW_PIN, Bit_RESET); mStop(mBoth); }