Proj 324 Final

Fork of ELEC351_Group_T by Plymouth ELEC351 Group T

SERIAL.cpp

Committer:
thomasmorris
Date:
2018-05-07
Revision:
53:71f59e195f06
Parent:
52:99915f5240b2

File content as of revision 53:71f59e195f06:

#include "SERIAL.hpp"
extern bool motor_direction = 0;
bool Decimal_Check(char Input[100])         //Check if there is a decimal within the Array
{
    for(int x = 0; x < sizeof(Input); x++)
    {
        if(Input[x] == '.'){return true;}   //Return true if one is found
    }
    return false;                           //Return false if one is not found
}

int Decimal_Position(char Input[100])       //Check where the decimal is positioned
{
    for(int x = 0; x < sizeof(Input); x++)  
    {
        if(Input[x] == '.'){return x;}      //Return the position x of the Decimal
    }
    return 0;    
}