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.
Fork of 4_1bueno by
main.cpp
00001 #include "mbed.h" 00002 #include "TextLCD.h" 00003 00004 TextLCD lcd(D4,D5,A2,A3,A4,A5); // rs, e, d4-d7 00005 AnalogIn val1(A0); 00006 AnalogIn val2(A1); 00007 DigitalOut motor(D6); 00008 Ticker flipper; 00009 float v1; 00010 float v2; 00011 float lima = 25.0f; 00012 float limb = 18.0f; 00013 00014 void flip() { 00015 v1 = val1; 00016 v2 = val2; 00017 v1 = v1 * 33.3f; 00018 v2 = v2 * 33.3f; 00019 } 00020 int main() { 00021 flipper.attach(&flip, 0.4); 00022 while(1) { 00023 lcd.printf("V1= %f C\nV2= %f C", v1,v2); 00024 wait(0.2); 00025 lcd.cls(); 00026 if(v1>=lima && v2<=limb) { 00027 motor = 1; 00028 } 00029 else motor = 0; 00030 } 00031 }
Generated on Sun Jul 31 2022 20:35:12 by
1.7.2
