#include "RGBled.h"

RGBled::RGBled(int R, int G, int B) : pinRed(R), pinGreen(G), pinBlue(B) {};

bool RGBled::begin(){
	pinMode(pinRed, OUTPUT);
	pinMode(pinGreen, OUTPUT);
	pinMode(pinBlue, OUTPUT);
	analogWrite(pinRed, 0);
	analogWrite(pinGreen, 0);
	analogWrite(pinBlue, 0);
	return true;
}
	
void RGBled::RED(){
	analogWrite(pinRed, 127);
	analogWrite(pinGreen, 0);
	analogWrite(pinBlue, 0);
}

void RGBled::GREEN(){
	analogWrite(pinRed, 0);
	analogWrite(pinGreen, 127);
	analogWrite(pinBlue, 0);
}

void RGBled::BLUE(){
	analogWrite(pinRed, 0);
	analogWrite(pinGreen, 0);
	analogWrite(pinBlue, 127);
}

void RGBled::CYAN(){
  analogWrite(pinRed, 0);
  analogWrite(pinGreen, 127);
  analogWrite(pinBlue, 127);
}

void RGBled::PURPLE(){
  analogWrite(pinRed, 127);
  analogWrite(pinGreen, 0);
  analogWrite(pinBlue, 127);
}

void RGBled::YELLOW(){
  analogWrite(pinRed, 127);
  analogWrite(pinGreen, 127);
  analogWrite(pinBlue, 0);
}

void RGBled::WHITE(){
  analogWrite(pinRed, 127);
  analogWrite(pinGreen, 127);
  analogWrite(pinBlue, 127);
}

void RGBled::OFF(){
	analogWrite(pinRed, 0);
	analogWrite(pinGreen, 0);
	analogWrite(pinBlue, 0);
}
