Data Sheet
VMA325
V. 01 – 19/03/2018 4 ©Velleman nv
Please also read the data sheet of the TCS2300, which is included in the VMA325.zip available from our
website.
// CODE BEGIN
#include <TimerOne.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h> //This is only needed if You connect a I2C LCD to Your microcontroller
LiquidCrystal_I2C lcd(0x27,20,4);
#define S0 6
#define S1 5
#define S2 4
#define S3 3
#define OUT 2
#define LED 7
int g_count = 0; // count the frequency
int g_array[3]; // store the RGB value
int g_flag = 0; // filter of RGB queue
float g_SF[3]; // save the RGB Scale factor
// Init TSC230 and setting Frequency.
void TSC_Init()
{
pinMode(S0, OUTPUT);
pinMode(S1, OUTPUT);
pinMode(S2, OUTPUT);
pinMode(S3, OUTPUT);
pinMode(OUT, INPUT);
pinMode(LED, OUTPUT);
digitalWrite(S0, LOW);// OUTPUT FREQUENCY SCALING 2%
digitalWrite(S1, HIGH);
digitalWrite(LED,HIGH) ; // LOW = Switch ON the 4 LED's , HIGH = switch off the 4 LED's
}
// Select the filter color//
void TSC_FilterColor(int Level01, int Level02)
{
if(Level01 != 0)
Level01 = HIGH;