background image

 

VMA325 

V. 01 – 19/03/2018 

©Velleman nv 

 } 
 
 void setup() 
 { 
   TSC_Init(); 
   lcd.init(); 
   delay(100); 
   lcd.backlight(); 
   Wire.begin();   
   delay(100); 
   lcd.setCursor(14,0); 
   lcd.print("Color"); 
   lcd.setCursor(0,3); 
   lcd.print("S0:2 S1:3 S2:4 S3:5 OUT:6 LED:-"); 
   Serial.begin(9600); 
   Timer1.initialize();             // defaulte is 1s 
   Timer1.attachInterrupt(TSC_Callback);   
   attachInterrupt(0, TSC_Count, RISING);    
   delay(4000);  
   for(int i=0; i<3; i++) 
   Serial.println(g_array[i]); 
   g_SF[0] = 255.0/ g_array[0];     //R Scale factor 
   g_SF[1] = 255.0/ g_array[1] ;    //G Scale factor  
   g_SF[2] = 255.0/ g_array[2] ;    //B Scale factor 
     
   Serial.println(g_SF[0]); 
   Serial.println(g_SF[1]); 
   Serial.println(g_SF[2]);  
    
  //for(int i=0; i<3; i++) 
   // Serial.println(int(g_array[i] * g_SF[i])); 
 } 
 void loop() 
 { 
   g_flag = 0;  
   for(int i=0; i<3; i++) 
     
   { 
     Serial.println(int(g_array[i] * g_SF[i])); 
     //lcd.setCursor(0,1); 
     //lcd.print(int(g_array[i] * g_SF[i])); 
   } 
   lcd.setCursor(0,1); 
   lcd.print(int(g_array[0] * g_SF[0])); 
   lcd.setCursor(6,1); 
   lcd.print(int(g_array[1] * g_SF[1])); 
   lcd.setCursor(12,1); 
   lcd.print(int(g_array[2] * g_SF[2])); 
   delay(4000);  
   Clean2004(); 
 } 
  
 void Clean2004() 

Summary of Contents for VMA325

Page 1: ...VMA325 COLOR SENSOR TCS3200 MODULE USER MANUAL ...

Page 2: ...tions of the device before actually using it All modifications of the device are forbidden for safety reasons Damage caused by user modifications to the device is not covered by the warranty Only use the device for its intended purpose Using the device in an unauthorised way will void the warranty Damage caused by disregard of certain guidelines in this manual is not covered by the warranty and th...

Page 3: ...output frequency scaling selection input S1 output frequency scaling selection input S2 photodiode type selection input S3 photodiode type selection input V 5 VDC power supply G ground OE output enable must be connected to G ground LED LED enable input low ON 7 Example Connection V 5V GND GND S0 D3 S1 D4 S2 D5 S3 D6 OUT D2 LED D7 OE GND Connect your VMA325 to your microcontroller VMA100 as above D...

Page 4: ...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 digi...

Page 5: ...cd setCursor 0 0 lcd print Start Serial println g_count g_array 0 g_count TSC_WB HIGH HIGH break case 2 Serial print Frequency G Serial println g_count g_array 1 g_count TSC_WB LOW HIGH break case 3 Serial print Frequency B Serial println g_count Serial println WB End g_array 2 g_count TSC_WB HIGH LOW break default g_count 0 break void TSC_WB int Level0 int Level1 White Balance g_count 0 g_flag TS...

Page 6: ...al println g_array i g_SF 0 255 0 g_array 0 R Scale factor g_SF 1 255 0 g_array 1 G Scale factor g_SF 2 255 0 g_array 2 B Scale factor Serial println g_SF 0 Serial println g_SF 1 Serial println g_SF 2 for int i 0 i 3 i Serial println int g_array i g_SF i void loop g_flag 0 for int i 0 i 3 i Serial println int g_array i g_SF i lcd setCursor 0 1 lcd print int g_array i g_SF i lcd setCursor 0 1 lcd p...

Page 7: ... or injury resulting from incorrect use of this device For more info concerning this product and the latest version of this manual please visit our website www velleman eu The information in this manual is subject to change without prior notice COPYRIGHT NOTICE The copyright to this manual is owned by Velleman nv All worldwide rights reserved No part of this manual may be copied reproduced transla...

Page 8: ...n shocks falls dust dirt humidity and by the article as well as its contents e g data loss compensation for loss of profits consumable goods parts or accessories that are subject to an aging process during normal use such as batteries rechargeable non rechargeable built in or replaceable lamps rubber parts drive belts unlimited list flaws resulting from fire water damage lightning accident natural...

Reviews: