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.
Dependencies: mbed
main.cpp
- Committer:
- Hammer4400
- Date:
- 2017-05-10
- Revision:
- 1:0b2a1b4bf3a3
- Parent:
- 0:f0609ea1bd97
File content as of revision 1:0b2a1b4bf3a3:
#include "mbed.h"
DigitalOut myled(LED1);
DigitalIn up(p5);
DigitalIn down(p6);
extern int timespan;
int t;
int i, set_temp;
int temperature_low,temperature_high;
int main(){
while(i<1){ //Open set_temp for user input.
if (up==1) {//recieve input from user
set_temp = (set_temp +1); } // when "up" tricked set_temp raise 1
if (down==1) {
set_temp = (set_temp -1);} // when "down" tricked set_temp raise 1
else if (timespan == 500);{
/* if 500 ms passes without a user input
the program will break the loop*/
break;}
}
int temperature_low = (set_temp-5);
int temperature_high = (set_temp+5);
/* Temperature that defines what uncomfortable */
i=2;
t=700; //force the program to pass hibernation.
return 0;
}