FINAL PROJECT isn't it

Fork of ELEC351 by Plymouth ELEC351 Group T

Committer:
thomasmorris
Date:
Wed Aug 15 21:34:59 2018 +0000
Revision:
57:aba1296e51b1
Parent:
53:71f59e195f06
Final Version

Who changed what in which revision?

UserRevisionLine numberNew 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 }