Ray Liu
/
NuMaker-mbed-PWM1_DCservo
Modify the file main.cpp for M487
README.md@0:6e96e6e154d1, 2017-09-29 (annotated)
- Committer:
- shliu1
- Date:
- Fri Sep 29 05:45:11 2017 +0000
- Revision:
- 0:6e96e6e154d1
main.cpp adds the setting of TARGET_NUMAKER_PFM_M487 for M487
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shliu1 | 0:6e96e6e154d1 | 1 | # Getting started PWM1 with DC servo motor on mbed OS |
shliu1 | 0:6e96e6e154d1 | 2 | |
shliu1 | 0:6e96e6e154d1 | 3 | |
shliu1 | 0:6e96e6e154d1 | 4 | ### Import NuMaker-mbed-PWM1_DCservo from on-line IDE |
shliu1 | 0:6e96e6e154d1 | 5 | 1. Please choose Nuvoton NuMaker-PFM-XXX as your target platform. |
shliu1 | 0:6e96e6e154d1 | 6 | 2. Please press the left-up icon "New", then choose "NuMaker PWM1 drive + 5V DC servo motor" from the template list. |
shliu1 | 0:6e96e6e154d1 | 7 | 3. Your NuMaker-mbed-PWM1_DCservo program is existed. |
shliu1 | 0:6e96e6e154d1 | 8 | |
shliu1 | 0:6e96e6e154d1 | 9 | #### Now compile |
shliu1 | 0:6e96e6e154d1 | 10 | Please press compile icon. |
shliu1 | 0:6e96e6e154d1 | 11 | |
shliu1 | 0:6e96e6e154d1 | 12 | #### Burn Code & Execute |
shliu1 | 0:6e96e6e154d1 | 13 | 1. Connect the board NuMaker-PFM-XXX with your PC by USB cable, then there will be one "mbed" disk. |
shliu1 | 0:6e96e6e154d1 | 14 | 2. Copy the built binary file into "mbed" disk on you PC. |
shliu1 | 0:6e96e6e154d1 | 15 | 3. Press device's reset button to execute, and you could get the below log by uart console. |
shliu1 | 0:6e96e6e154d1 | 16 | ------------------------------------------------------------------------------- |
shliu1 | 0:6e96e6e154d1 | 17 | ...DCserv Start... |
shliu1 | 0:6e96e6e154d1 | 18 | DCservo pulse width = 500 |
shliu1 | 0:6e96e6e154d1 | 19 | DCservo pulse width = 700 |
shliu1 | 0:6e96e6e154d1 | 20 | |
shliu1 | 0:6e96e6e154d1 | 21 | : |
shliu1 | 0:6e96e6e154d1 | 22 | : |
shliu1 | 0:6e96e6e154d1 | 23 | ...DCserv End..... |
shliu1 | 0:6e96e6e154d1 | 24 | -------------------------------------------------------------------------- |
shliu1 | 0:6e96e6e154d1 | 25 | PWM1 outputs to drive DC servo motor |