MTU COMP71004 Summer 2021 / Mbed 2 deprecated lect7_1

Dependencies:   mbed

main.cpp

Committer:
kinii
Date:
2021-07-13
Revision:
0:fcc5f3a4700c

File content as of revision 0:fcc5f3a4700c:

#include "mbed.h"

AnalogIn p1(p19);       //pot1 

int main() {
    while(1) {
        float p1_float = p1;    // read pot1 value
        float p1_volts = p1_float * 3.3;    // convert analog value to voltage
        printf("float: %f volts: %f \r\n",p1_float, p1_volts);
        wait(3);  
    }
}