Skip to content

Instantly share code, notes, and snippets.

View barrylachapelle's full-sized avatar

Barry Lachapelle barrylachapelle

View GitHub Profile
void ofApp::stringtocolor(string convertstring){
int hash = std::hash<std::string>()(convertstring);
int r = (hash & 0xFF0000) >> 16;
int g = (hash & 0x00FF00) >> 8;
int b = hash & 0x0000FF;
cout << r << "| "<< g << "| " << b << endl;
}
@barrylachapelle
barrylachapelle / Arduino parse CSV data to array
Created May 8, 2015 02:08
Arduino parse CSV data to array
//libs
#include <SPI.h>
#include <SD.h>
//SD vars
File myFile;
//parse data vals
int dataarr[60] = {}; //array of parsed data
int arrpointer = 0; //array pointer