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: mbed
main.cpp
00001 #include "mbed.h" 00002 #include "flow.h" 00003 00004 DigitalOut r1(D1); 00005 DigitalOut r2(D2); 00006 DigitalOut y1(D3); 00007 DigitalOut g1(D4); 00008 DigitalOut y2(D5); 00009 DigitalOut r3(D6); 00010 00011 00012 int main() 00013 { 00014 r1=0; 00015 r2=0; 00016 y1=0; 00017 g1=0; 00018 y2=0; 00019 r3=0; 00020 00021 while(1) { 00022 00023 00024 if (flow()<3.49) 00025 { 00026 00027 r1=1; 00028 r2=0; 00029 y1=0; 00030 g1=0; 00031 y2=0; 00032 r3=0; 00033 printf("%f \n", flow()); 00034 00035 } 00036 if (flow()>=3.49 and flow()<54.74) 00037 { 00038 r1=1; 00039 r2=1; 00040 y1=0; 00041 g1=0; 00042 y2=0; 00043 r3=0; 00044 printf("%f \n", flow()); 00045 } 00046 if (flow()>=54.74 and flow()<180.42) 00047 { 00048 r1=1; 00049 r2=1; 00050 y1=1; 00051 g1=0; 00052 y2=0; 00053 r3=0; 00054 printf("%f \n", flow()); 00055 } 00056 if (flow()>=180.42 and flow()<223.21) 00057 { 00058 r1=1; 00059 r2=1; 00060 y1=1; 00061 g1=1; 00062 y2=0; 00063 r3=0; 00064 printf("%f \n", flow()); 00065 } 00066 if (flow()>=223.21 and flow()<270.55) 00067 { 00068 r1=1; 00069 r2=1; 00070 y1=1; 00071 g1=1; 00072 y2=1; 00073 r3=0; 00074 printf("%f \n", flow()); 00075 } 00076 00077 if (flow()>=270.55) 00078 { 00079 r1=1; 00080 r2=1; 00081 y1=1; 00082 g1=1; 00083 y2=1; 00084 r3=1; 00085 printf("%f \n", flow()); 00086 } 00087 00088 00089 } 00090 }
Generated on Wed Jul 20 2022 23:36:07 by
1.7.2