Matthew Pybus / Mbed 2 deprecated Master

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 //input of typingflag wired
00004 //input of distance sensor wireless
00005 //input from fob reader
00006 
00007 int typingtime=0;
00008 int sittingtime=0;
00009 int productivity=0;
00010 
00011 
00012 int main() {
00013 
00014     while(1)
00015     {   
00016         
00017         if(fobreader!=0x00)
00018         {
00019             productivity=0      //reset the productivity if a new fob is read.
00020         }
00021         
00022         if(typingflag==0x01)
00023         {
00024             typingtime++;
00025         }
00026         
00027         if(sittingflag==1)
00028         {
00029             sittingtime++;
00030         }
00031         
00032       producitvity=sittingtime+7*typingtime;
00033       
00034          //have the LCD display the productivity.
00035       
00036       if(sittingtime>1200)
00037         {
00038           //have the LCD display "Take a break?"  
00039         
00040       wait(1);
00041         
00042     }
00043 }