Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- yu10078999
- Date:
- 2016-09-04
- Revision:
- 1:d257a5dacc0b
- Parent:
- 0:93daf3a92680
File content as of revision 1:d257a5dacc0b:
#include "mbed.h"
DigitalOut led(D2);
AnalogIn CDS(A0);
int main() {
float val;
while(1) {
val=CDS.read();
printf("%f\n",val);
wait(0.2);
if(val<0.4f){
led=0;
}
else if(val>=0.4f){
led=1;
}
}
}