WOSP color sensor

Navigation:  Spectrometers > Tinkerforge components >

WOSP color sensor

Previous pageReturn to chapter overviewNext page

This object contols a TinkerForge color sensor bricklet. This device can be used for rapid (and rough) color and brightness measurements. It measures 4 numbers called R, G, B and C which are intensities for red, green and blue light and a gray value for the overall brightness. The sensor provides a white LED which can be switched on and off programmatically.

The sensor looks like this:

 

clip0022

The color sensor must be connected to a so-called 'Tinkerforge brick' which is connected to a computer and can be controlled by SCOUT. Bricks supported by SCOUT are the master brick, the servo brick and the stepper brick.

 

Before you use the color sensor in SCOUT you should test it with the Tinkerforge brickv tool. You need to know the host computer, the port and UID of the device in order to use it in SCOUT.

The dialog to set the properties and test the sensor in SCOUT is this:

 

clip0021

 

Color sensors listen to the following script commands:

object command, my_sensor, acquire   // tells the sensor to acuire new color values

object command, my_sensor, light on   // switch on the light

object command, my_sensor, light off   // switch off the light

 

You can use these optical functions to retrieve information from color sensors:

my_sensor (r)   // returns the red color intensity value R, range of values is 0 ...65535

my_sensor (g)   // returns the green color intensity value G, range of values is 0 ...65535

my_sensor (b)   // returns the blue color intensity value B, range of values is 0 ...65535

my_sensor (c)   // returns the brightness value C, range of values is 0 ...65535

my_sensor (r_relative)   // returns the red color intensity value R divided by the brightness C

my_sensor (g_relative)   // returns the green color intensity value G divided by the brightness C

my_sensor (b_relative)   // returns the blue color intensity value B divided by the brightness C