Course project for LE484 at Thammasat University, class of 2016

Committer:
3ecauz
Date:
Mon May 08 04:44:33 2017 +0000
Revision:
8:12d666d1afb4
Parent:
7:d702abfe51e3
Child:
9:5b4959a735a1
Delete LED code on sensortask

Who changed what in which revision?

UserRevisionLine numberNew contents of line
3ecauz 7:d702abfe51e3 1 #include "mbed.h"
3ecauz 7:d702abfe51e3 2 #include "platform.h"
3ecauz 7:d702abfe51e3 3
3ecauz 7:d702abfe51e3 4 AnalogIn analog_value(A0);
3ecauz 7:d702abfe51e3 5 DigitalOut led(LED1);
3ecauz 7:d702abfe51e3 6
3ecauz 8:12d666d1afb4 7 void sensorIn()
3ecauz 8:12d666d1afb4 8 {
3ecauz 7:d702abfe51e3 9 float meas;
3ecauz 8:12d666d1afb4 10
3ecauz 7:d702abfe51e3 11 while(1) {
3ecauz 7:d702abfe51e3 12 meas = analog_value.read();
3ecauz 8:12d666d1afb4 13 meas = meas * 3300;
3ecauz 7:d702abfe51e3 14 printf("measure = %.0f mV\n", meas);
3ecauz 8:12d666d1afb4 15
3ecauz 7:d702abfe51e3 16 }
3ecauz 8:12d666d1afb4 17 }