Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- simon
- Date:
- 2009-12-01
- Revision:
- 0:c795e64e9eb0
- Child:
- 1:4115ae4cbc76
File content as of revision 0:c795e64e9eb0:
// Testing PWM channel 0 vs channel 1 behaviour, sford #include "mbed.h" PwmOut pwm1(p26); PwmOut pwm2(p25); int main() { uint32_t t = 10000; // set period LPC_PWM1->MR0 = t; LPC_PWM1->LER |= 1 << 0; while (1) { // set pulsewidth to 100% LPC_PWM1->MR1 = t; LPC_PWM1->MR2 = t; LPC_PWM1->LER |= 0x6; // wait for update while (LPC_PWM1->LER); // set pulsewidth less than 100% LPC_PWM1->MR1 = t - 500; LPC_PWM1->MR2 = t - 500; LPC_PWM1->LER |= 0x6; // wait for update while (LPC_PWM1->LER); } }