.

Dependencies:   mbed FXOS8700Q

main.cpp

Committer:
karlaivon
Date:
2020-05-30
Revision:
0:77181102b27d

File content as of revision 0:77181102b27d:

#include "mbed.h"
#include "C12832.h"

C12832 lcd(SPI_MOSI, SPI_SCK, SPI_MISO, p8, p11);

AnalogIn Ain(p20);
float ADCdata, voltaje;

int main () {
       while (1) {
           ADCdata=Ain;
           lcd.locate(0,3);
           lcd.printf("%f", ADCdata);
           voltaje=ADCdata * (3.3f/65535.0f)*100000;
           
           lcd.locate(0,16);
           lcd.printf("%f", voltaje);
           printf("%f /n/r", ADCdata);
           wait(0.5);
           
        }
    }