王 皓平
/
Nucleo_pwmPIControler
lab2
main.cpp
- Committer:
- HPWang
- Date:
- 2016-03-09
- Revision:
- 0:7b2e8e9735ec
File content as of revision 0:7b2e8e9735ec:
#include "mbed.h" PwmOut mypwm(PWM_OUT); float nagle_ref = 0.0; float nagle_read = 0.0; float nagle_check; float err = 0.0; float ierr = 0.0; float PI_out = 0.0; float pwm1_duty = 0.5; ㄎㄛ int main() { mypwm.period_ms(10); mypwm.pulsewidth_ms(1); printf("pwm set to %.2f %%\n", mypwm.read() * 100); while(1) { myled = !myled; wait(1); } }