newest version,

Dependencies:   QEI mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers check_state.cpp Source File

check_state.cpp

00001 /*
00002  * check_state.cpp
00003  *
00004  *  Created on: Oct 20, 2015
00005  *      Author: User
00006  */
00007 #include <string>
00008 using namespace std;
00009 
00010 string check_state(double left_input, double right_input, double threashold)
00011 {
00012     if (left_input > threashold and right_input > threashold)
00013     {
00014         return("keypress");
00015     }
00016 
00017     else if (left_input > threashold)
00018     {
00019         return("left");
00020     }
00021 
00022     else if (right_input > threashold)
00023     {
00024         return("left");
00025     }
00026 
00027     else
00028     {
00029         return("rest");
00030     }
00031 }
00032 
00033 
00034 
00035