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.

  • 3,290 views
  • 1 comment
  • 10 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

  • 2,560 views
  • 0 comments
  • 1 respect

4x4x4 LED cube with Arduino Uno and 1sheeld

Project tutorial by Hassan Ibrahim

  • 35,860 views
  • 7 comments
  • 64 respects

Controlling LED light intensity using smartphone light senso

Project tutorial by Nikola Travis

  • 2,995 views
  • 0 comments
  • 4 respects

Control your light system with your voice

Project tutorial by Maha Raafat

  • 42,026 views
  • 22 comments
  • 160 respects

Track and Control Your Car Remotely

Project tutorial by Ashraf Nabil

  • 34,078 views
  • 5 comments
  • 71 respects

Bluetooth control led with lcd led status display real time.

Project tutorial by Youssef Sabaa

  • 28,510 views
  • 6 comments
  • 54 respects
Add projectSign up / Login