Code Monkey home page Code Monkey logo

simplergb's Introduction

Simple RGB

Simple usage of Adafruit TCS34725

Author

Jorge Villalobos - Jun.2017

Requires

Prior installation of the Adafruit TCS34725 library

Usage

#include <SensorRGB.h>

// ---- Variables
SensorRGB rgb;

void setup() {
  Serial.begin(9600);
  Serial.println("Simple RGB");
  Serial.println("Jorge Villalobos C. - v1.0 - Jun.2017");
  Serial.println("");

  Serial.println(rgb.inicio() ? "Sensor TCS34725 found": "TCS34725 Sensor NOT FOUND !!!");
}  // void setup();

void loop() {
  // Do the color reading
  rgb.getRGBColor();
  Serial.print("Detected color: ");
  
  // Displays the RGB composition of the detected color
  Serial.print(" | R:"); Serial.print(rgb.red());
  Serial.print(" - G:"); Serial.print(rgb.green());
  Serial.print(" - B:"); Serial.print(rgb.blue());
  Serial.println("");
  delay(300);
}  // void loop()

Methods

Method Description
begin() Initialize the TCS34725 sensor
getRGBColor() Do the reading
red() Red value read
green() Green value read
blue() Blue value read
clear() Clear value read
diff(r, g, b) Calculate the Euclidean distance of the detected color with the color RGB passed as a parameter

License

Released under MIT License

simplergb's People

Contributors

jorgemvc avatar

Watchers

 avatar  avatar

Forkers

per1234

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.