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.
Dependencies: TSI TextLCD mbed
main.cpp
00001 #include "mbed.h" 00002 #include "TSISensor.h" 00003 #include "TextLCD.h" 00004 00005 TextLCD lcd(PTB10, PTB11, PTE2, PTE3, PTE4, PTE5); // rs, e, d4-d7 00006 Timer t1; 00007 float anchop=0.5; 00008 float periodo=100; 00009 int main(void) { 00010 00011 PwmOut led(PTA5); 00012 TSISensor tsi; 00013 led.pulsewidth(anchop); 00014 led.period_ms(periodo); 00015 00016 while (true) { 00017 if(tsi.readPercentage()!=0){ 00018 led = 1.0 - tsi.readPercentage(); 00019 lcd.cls(); 00020 lcd.printf("PWM=%g",tsi.readPercentage()); 00021 } 00022 wait(0.1); 00023 } 00024 }
Generated on Thu Jul 14 2022 06:20:39 by
1.7.2