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.
Diff: conversor.cpp
- Revision:
- 0:f2560180665b
- Child:
- 1:d05e46c73155
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conversor.cpp Mon Jun 08 14:22:31 2020 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +DigitalOut saida_0(D2); +DigitalOut saida_1(D3); +DigitalOut saida_2(D4); + +AnalogIn leitura_an(A0); +Serial pc(USBTX, USBRX); +float valor; + +int main(){ + pc.baud(9600); + pc.printf("\r"); + while(1){ + valor = 3.3*leitura_an.read(); //conversão propriamente dita + pc.printf("\r\t%1.3f\n", valor); + wait(0.5); + } + } + \ No newline at end of file