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.
Revision 0:8fa77db93e75, committed 2014-08-07
- Comitter:
- fedeedlp
- Date:
- Thu Aug 07 19:39:59 2014 +0000
- Commit message:
- First Commit
Changed in this revision
diff -r 000000000000 -r 8fa77db93e75 Servo.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Servo.lib Thu Aug 07 19:39:59 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/Servo/#36b69a7ced07
diff -r 000000000000 -r 8fa77db93e75 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Aug 07 19:39:59 2014 +0000 @@ -0,0 +1,56 @@ +/*This program monitoring the light and the temperature and send a serial command (if the user chose it) and turn on a light signal*/ + +#include "mbed.h" +#include "Servo.h" + +Servo Servo_Temp(D13); +Servo Servo_Light(D14); +AnalogIn temperature(A0); +AnalogIn light(A1); +DigitalOut temp_alert(D0); +DigitalOut light_alert(D1); +int i; +Serial pc(USBTX, USBRX); // tx, rx + +int main() +{ + temp_alert=0; + light_alert=0; + pc.printf("Press 'y' to receive commands or 'n' for not receive\n"); + char mode = pc.getc(); + while(1) { + if (temperature>5) { //High Temperature + i=0; + while(i<10) { + temp_alert=1; + wait(1); + temp_alert=0; + i++; + } + temp_alert=1; + Servo_Temp.position(0); + if(mode=='y') + pc.printf("High Temperature"); + + } else + temp_alert=0; + Servo_Temp.position(100); + + if (light<1) { //Low Light + i=0; + while(i<10) { + light_alert=1; + wait(1); + light_alert=0; + i++; + } + light_alert=1; + Servo_Light.position(0); + if(mode=='y') + pc.printf("Low Light"); + } else + light_alert=0; + Servo_Light.position(100); + wait(1); + } +}
diff -r 000000000000 -r 8fa77db93e75 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Aug 07 19:39:59 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6213f644d804 \ No newline at end of file