Project tutorial
Control a RGB Led using Arduino and a smartphone's camera

Control a RGB Led using Arduino and a smartphone's camera

Color detection with Arduino and smartphone - output on RGB LED using 1Sheeld color sensor.

  • 2,756 views
  • 0 comments
  • 8 respects

Components and supplies

About this project


Code

Untitled fileArduino
#define CUSTOM_SETTINGS
#define INCLUDE_COLOR_DETECTOR_SHIELD


#include <OneSheeld.h>


int redPin = 11;
int greenPin =10;
int bluePin = 9;

void setup() {
  OneSheeld.begin();
  pinMode(redPin, OUTPUT); 
  pinMode(greenPin, OUTPUT); 
  pinMode(bluePin, OUTPUT);
  ColorDetector.setPalette(_3_BIT_RGB_PALETTE);
}

void loop() {
  if(ColorDetector.isNewColorReceived())
  {
    Color readColor = ColorDetector.getLastColor();
    byte redValue = readColor.getRed();
    byte greenValue = readColor.getGreen();
    byte blueValue = readColor.getBlue();
   
    digitalWrite(redPin,redValue);
    digitalWrite(greenPin,greenValue);
    digitalWrite(bluePin,blueValue);    
  }
}
Codebender

Schematics

schematics
Untitled%20sketch bb

Comments

Similar projects you might like

Controlling an RGB LED with Color Detector Camera

Project tutorial by Zowail

  • 1,330 views
  • 0 comments
  • 1 respect

4x4x4 LED cube with Arduino Uno and 1sheeld

Project tutorial by Hassan Ibrahim

  • 29,728 views
  • 6 comments
  • 60 respects

Controlling LED light intensity using smartphone light senso

Project tutorial by Nikola Travis

  • 1,757 views
  • 0 comments
  • 3 respects

Control your light system with your voice

Project tutorial by Maha Raafat

  • 33,119 views
  • 22 comments
  • 147 respects

Track and Control Your Car Remotely

Project tutorial by Ashraf Nabil

  • 25,412 views
  • 5 comments
  • 58 respects

Bluetooth control led with lcd led status display real time.

Project tutorial by Youssef Sabaa

  • 17,309 views
  • 4 comments
  • 34 respects
Add projectSign up / Login