John Davis / Mbed 2 deprecated Lab2

Dependencies:   mbed

Exercise1.cpp

Committer:
m161440
Date:
2014-09-09
Revision:
0:029c836ac188

File content as of revision 0:029c836ac188:

#include "mbed.h"
Serial pc(USBTX, USBRX);
AnalogIn voltage(p20);

  int main()
  {
    pc.baud(921600);
    
    
    while(1)
    {
        float v= voltage;
        voltage.read();
        printf("analog value = %f\n",v);
        printf("voltage = %f \n",3.3*v);
        wait(.5);
    }
    
      
      }