Thomas Morris / Mbed OS PROJ324_Final

Fork of ELEC351_Group_T by Plymouth ELEC351 Group T

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SERIAL.cpp Source File

SERIAL.cpp

00001 #include "SERIAL.hpp"
00002 extern bool motor_direction = 0;
00003 bool Decimal_Check(char Input[100])         //Check if there is a decimal within the Array
00004 {
00005     for(int x = 0; x < sizeof(Input); x++)
00006     {
00007         if(Input[x] == '.'){return true;}   //Return true if one is found
00008     }
00009     return false;                           //Return false if one is not found
00010 }
00011 
00012 int Decimal_Position(char Input[100])       //Check where the decimal is positioned
00013 {
00014     for(int x = 0; x < sizeof(Input); x++)  
00015     {
00016         if(Input[x] == '.'){return x;}      //Return the position x of the Decimal
00017     }
00018     return 0;    
00019 }