nicolás rodríguez
/
BCD_GUIA2PT2
Voltímetro ADC y BCD
Fork of BCD_GUIA2 by
Diff: main.cpp
- Revision:
- 1:b6f946fdfb2f
- Parent:
- 0:246c93030d74
diff -r 246c93030d74 -r b6f946fdfb2f main.cpp --- a/main.cpp Sat Aug 12 21:54:13 2017 +0000 +++ b/main.cpp Sat Aug 19 21:44:23 2017 +0000 @@ -1,22 +1,18 @@ #include "BCDSEG.h" -#include "mbed.h" int numero; - -int main() +AnalogIn pot(A0); +float p; +int unid,dece; +int main() { - anodoo peinado; - peinado.visual(D6,D7,D8,D9,D10,D11,D12); - while(1) + anodoo peinado; + peinado.visual(D6,D7,D8,D9,D10,D11,D12); + while(1) { - numero = peinado.entrada(D2,D3,D4,D5); - - - - peinado.bcd(numero); - wait(0.5); - - - + p = (pot.read_u16()*0.00005); + dece=p; + unid=(p*10)-(dece*10); + peinado.dual(D4,D5,unid,dece,100); } -} +} \ No newline at end of file