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
00001 #include "mbed.h" 00002 /** 00003 Descripción: Controlar el ancho de pulso de una señal cuadrada PWM. 00004 con un pulsador en Pull-up y mostrar su variación a travez de un led 00005 conectado a un pin con salida PWM de la tarjeta. 00006 00007 */ 00008 00009 PwmOut LED(LED1); 00010 DigitalIn pulsador(PC_13); 00011 int T=0; 00012 00013 00014 main(){ 00015 while (1) 00016 { 00017 00018 while (pulsador == 0) 00019 { 00020 T++; 00021 if (T>2) T=1; 00022 wait(0.3); 00023 } 00024 00025 LED.pulsewidth(T); 00026 LED.period(4); 00027 00028 ///DigitalOut myled(LED1); 00029 00030 //int main() C 00031 00032 ///SPWM.period_ms(2000); 00033 ///SPWM.pulsewidth_ms(1000); 00034 00035 } 00036 }
Generated on Sun Aug 21 2022 13:19:47 by
1.7.2