Matej Tovornik / Mbed 2 deprecated A_Load_Cell

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002  
00003 Serial pc(SERIAL_TX, SERIAL_RX);
00004  
00005 AnalogIn analog_value(A0);
00006  
00007 DigitalOut led(LED1);
00008  
00009 float ADC_Value;
00010 float Teza;
00011  
00012  
00013  
00014 int main()
00015 {
00016  
00017     
00018  
00019     while(1) {
00020  
00021         ADC_Value = analog_value.read(); // Read the analog input value (value from 0.0 to 1.0 = full ADC conversion range)
00022         ADC_Value = ADC_Value*3.3;
00023         
00024         // Display values
00025        pc.printf("%f\n\r", ADC_Value);
00026         //pc.printf("%f\n\r", Teza);
00027         
00028         wait(1.0); // 1 second
00029     }
00030 }