GithubHelp home page GithubHelp logo

owainm713 / tcs34725-python-module Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 20 KB

TCS34725 colour sensor Python module

License: GNU General Public License v3.0

Python 100.00%
tcs34725 color-sensor colour-sensor raspberrypi python

tcs34725-python-module's Introduction

TCS34725-Python-Module

Python 2.x Module for use with a TCS34725 colour sensor and the Raspberry Pi. I used an adafruit TCS34725 colour sensor breakout board.

To use this module, run your program as the root user, i.e. sudo...

The module needs smbus to be installed to use the i2c interface. The i2c interface also needs to be enabled on your Raspberry Pi.

Also included are 2 example files, one that when run will output raw colour sensor data every second and the 2nd which will try reflecting the colour sensed via pygame and a tri colour LED. The 2nd example will also make a best guess at the name of the colour being sensed and print it out. The 2nd example requires the RPi.GPIO module

The connections to the adafruit TCS34725 colour sensor break out board I used are as follows:

  • TCS34725 LED connect to Gnd to turn off
  • TCS34725 Int - not connected but could be connected any Pi GPIO and used
  • TCS34725 SDA - Pi SDA
  • TCS34725 SCL - Pi SCL
  • TCS34725 3.3V - not connected
  • TCS34725 Gnd - Pi Gnd
  • TCS34725 Vin - Pi 3.3V

The i2c address for the TCS34725 colour sensor is 0x29.

The data sheet for the TCS34725 Colour sensor can be downloaded from the adafruit website

Current functions include:

  • clear_interrupt()
  • read_CRGB()
  • read_status()
  • set_enables(pon=0, aen=0, wen=0, aien=0)
  • set_gain(gain=1)
  • set_wait_time(wtime, wlong=0)
  • set_a_time(atime)
  • set_interrupt_levels(lowTL = 0, highTL = 65535, persLevel = 0)

tcs34725-python-module's People

Contributors

owainm713 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.