Programme V0
Embed:
(wiki syntax)
Show/hide line numbers
info1.cpp
00001 #include "mbed.h" 00002 #include "TSISensor.h" 00003 00004 00005 TSISensor tsi2; 00006 00007 void appui_num(int *bp) 00008 { 00009 if (tsi2.readPercentage()>0) 00010 *bp=1; 00011 else 00012 *bp=0; 00013 } 00014 00015 void appui_ana (int *bp1,int *bp2,float seuil) 00016 { 00017 00018 00019 if (tsi2.readPercentage()>0 && tsi2.readPercentage()<seuil) 00020 { 00021 *bp1=1; 00022 *bp2=0; 00023 } 00024 00025 else if (tsi2.readPercentage()>=seuil && tsi2.readPercentage()<=1) 00026 { 00027 *bp1=0; 00028 *bp2=1; 00029 } 00030 else 00031 { 00032 *bp1=0; 00033 *bp2=0; 00034 } 00035 }
Generated on Sat Aug 20 2022 19:04:41 by
1.7.2