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.
conversor.cpp
- Committer:
- amandarm
- Date:
- 2020-06-08
- Revision:
- 4:76d5fb3100a3
- Parent:
- 3:b0a44d2901a1
- Child:
- 5:436b7d88a92d
File content as of revision 4:76d5fb3100a3:
#include "mbed.h" #include <math.h> BusOut saida_digital (D2,D3,D4); DigitalIn botao_usuario(PC_13); AnalogIn leitura_an(A0); Serial pc(USBTX, USBRX); float valor; int SEQUENCIA[8]={ 0b000, 0b001, 0b010, 0b011, 0b100, 0b101, 0b110, 0b111 }; int main(){ pc.baud(9600); pc.printf("\r"); pc.printf("oi"); while(1){ for (int i=0; i<8; i++) { saida_digital = SEQUENCIA[i]; valor=leitura_an.read(); //valor = 3.3*leitura_an.read(); //conversão propriamente dita pc.printf("\r\t%1.3f\n", valor); wait(0.5); } } }