--- tags: Robot id, Program --- Different Cases === ## DAC Calibration ### STEP 1 [建立新專案](/kXwOv0yYTLeIlyHMMR7o0A?view) ### STEP 2 SET Main Function ```C++= #include "MotionCard.h" #include <iostream> #include <conio.h> //=============================================================== void _stdcall Timer_DAC(TMRINT *pstINTSource); //=============================================================== int main() { //-------------------- 開啟各項功能 -------------------- printf("Press 'Esc' to end program.\n"); MotionCard_OpenCard(); // 開啟軸卡 //---------------------- 工作流程 ---------------------- int sw = 0; while (sw != 0x1b) { //-------------------- 手動結束程式 -------------------- if (_kbhit()) { sw = _getch(); // 按ESC結束程式 } //---------------------- 切換中斷 ---------------------- double Voltage = 0.0; MotionCard_DAC(0, Voltage); // 送出電壓 MotionCard_DAC(1, Voltage); MotionCard_DAC(2, Voltage); MotionCard_DAC(3, Voltage); MotionCard_DAC(4, Voltage); MotionCard_DAC(5, Voltage); } //-------------------- 關閉各項功能 -------------------- MotionCard_CloseCard(); // 關閉軸卡 } void _stdcall Timer_DAC(TMRINT *pstINTSource) { int Axis = 7; double Voltage = 0.0; MotionCard_DAC(Axis, Voltage); // 送出電壓 } ``` ### STEP 3 硬體配合 - 用未接線的軸卡轉接版測定電壓 - 利用程式給定電壓0V,調整可變電阻使其量測出之電壓平均值為0。 ## PTP Control
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up