Plymouth ELEC351 Group T
/
ELEC351_Group_T
FINAL PROJECT isn't it
Fork of ELEC351 by
SERIAL.cpp@53:71f59e195f06, 2018-05-07 (annotated)
- Committer:
- thomasmorris
- Date:
- Mon May 07 15:44:34 2018 +0000
- Revision:
- 53:71f59e195f06
- Parent:
- 52:99915f5240b2
To test version of code;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thomasmorris | 25:36699ed589ab | 1 | #include "SERIAL.hpp" |
thomasmorris | 53:71f59e195f06 | 2 | extern bool motor_direction = 0; |
thomasmorris | 52:99915f5240b2 | 3 | bool Decimal_Check(char Input[100]) //Check if there is a decimal within the Array |
thomasmorris | 47:6d128e500875 | 4 | { |
thomasmorris | 47:6d128e500875 | 5 | for(int x = 0; x < sizeof(Input); x++) |
thomasmorris | 47:6d128e500875 | 6 | { |
thomasmorris | 52:99915f5240b2 | 7 | if(Input[x] == '.'){return true;} //Return true if one is found |
thomasmorris | 47:6d128e500875 | 8 | } |
thomasmorris | 52:99915f5240b2 | 9 | return false; //Return false if one is not found |
thomasmorris | 47:6d128e500875 | 10 | } |
thomasmorris | 47:6d128e500875 | 11 | |
thomasmorris | 52:99915f5240b2 | 12 | int Decimal_Position(char Input[100]) //Check where the decimal is positioned |
thomasmorris | 47:6d128e500875 | 13 | { |
thomasmorris | 52:99915f5240b2 | 14 | for(int x = 0; x < sizeof(Input); x++) |
thomasmorris | 47:6d128e500875 | 15 | { |
thomasmorris | 52:99915f5240b2 | 16 | if(Input[x] == '.'){return x;} //Return the position x of the Decimal |
thomasmorris | 47:6d128e500875 | 17 | } |
thomasmorris | 47:6d128e500875 | 18 | return 0; |
thomasmorris | 25:36699ed589ab | 19 | } |