This repository has been archived on 2019-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
PixelHub/PixelHub-Client/Utilities.cpp

32 lines
601 B
C++

//#include <string.h>
//#include <algorithm>
#include <stdlib.h>
#include "Utilities.h"
#include "Arduino.h"
int findChar(char* str, char targetChar)
{
for(int i = 0; str[i] != '\0'; i++) {
if(str[i] == targetChar) return i;
}
}
/*
int getPosition(const char *array, size_t size, char c)
{
const char* end = array + size;
const char* match = std::find(array, end, c);
return (end == match)? -1 : (match-array);
}
*/
void Utilities::PrintCharsAsHex(char* charArray, size_t length)
{
for(int i = 0; i < length; i++)
{
Serial.print((int)(charArray[i]), HEX);
Serial.print(" ");
}
}