Matthew Pybus
/
Master
master board, calculating productivity
main.cpp
- Committer:
- MPybus
- Date:
- 2013-05-03
- Revision:
- 0:fb3382f64def
File content as of revision 0:fb3382f64def:
#include "mbed.h" //input of typingflag wired //input of distance sensor wireless //input from fob reader int typingtime=0; int sittingtime=0; int productivity=0; int main() { while(1) { if(fobreader!=0x00) { productivity=0 //reset the productivity if a new fob is read. } if(typingflag==0x01) { typingtime++; } if(sittingflag==1) { sittingtime++; } producitvity=sittingtime+7*typingtime; //have the LCD display the productivity. if(sittingtime>1200) { //have the LCD display "Take a break?" wait(1); } }