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 #include "TextLCD.h" 00003 00004 TextLCD lcd(p5, p6, p7, p8, p9, p10); // rs, e, d4-d7 00005 00006 AnalogIn P1(p15); 00007 PwmOut led(LED1); 00008 PwmOut FM(p21); 00009 00010 float Px; 00011 int PWM; 00012 00013 int main() { 00014 00015 led.period_ms (150); 00016 00017 while(1) { 00018 00019 Px = P1.read(); 00020 00021 if(Px < 0.1){ 00022 Px = 0.1; 00023 } 00024 if(Px > 0.9){ 00025 Px = 0.9; 00026 } 00027 00028 PWM = Px*100; 00029 led = Px; 00030 FM = Px; 00031 Px = Px * 3.3; 00032 lcd.printf("S_FMBM = %2d PWM\n",PWM); 00033 lcd.printf("V15 = %2.2f V\n",Px); 00034 } 00035 } 00036 00037
Generated on Wed Jul 20 2022 02:58:59 by
1.7.2