
Features
- The on-board TCS3200D color sensors
- Support 3V-5V voltage input
- Chip pins all has drawn for standard 100, put the needle (2.54 mm), mil-convenient for bitmap board
- Diameter: 38mm
The Price Was:
Related ProductsRelated Products
- Ultrasonic Module HC-SR04 Distance Sensor For Arduino
- HC-SR501 Human Sensor Module Pyroelectric Infrared
- Arduino Uno R3

| Product Description |
Product Description
Code:
int s0=3,s1=4,s2=5,s3=6;
int out=2;
int flag=0;
byte counter=0;
byte countR=0,countG=0,countB=0;
void setup()
Serial.begin(115200);
pinMode(s0,OUTPUT);
pinMode(s1,OUTPUT);
pinMode(s2,OUTPUT);
pinMode(s3,OUTPUT);
void TCS()
flag=0;
digitalWrite(s1,HIGH);
digitalWrite(s0,HIGH);
digitalWrite(s2,LOW);
digitalWrite(s3,LOW);
attachInterrupt(0, ISR_INTO, LOW);
timer0_init();
void ISR_INTO()
counter++;
void timer0_init(void)
TCCR2A=0x00;
TCCR2B=0x07; //the clock frequency source 1024 points
TCNT2= 100; //10 ms overflow again
TIMSK2 = 0x01; //allow interrupt
int i=0;
ISR(TIMER2_OVF_vect)//the timer 2, 10ms interrupt overflow again. Internal overflow interrupt executive function
TCNT2=100;
flag++;
if(flag==1)
countR=counter;
Serial.print("red=");
Serial.println(countR,DEC);
digitalWrite(s2,HIGH);
digitalWrite(s3,HIGH);
else if(flag==2)
countG=counter;
Serial.print("green=");
Serial.println(countG,DEC);
digitalWrite(s2,LOW);
digitalWrite(s3,HIGH);
else if(flag==3)
countB=counter;
Serial.print("blue=");
Serial.println(countB,DEC);
Serial.println("\n");
digitalWrite(s2,LOW);
digitalWrite(s3,LOW);
else if(flag==4)
flag=0;
counter=0;
void loop()
TCS();
while(1);
Package List:
1x SainSmart Color Recognition Sensor TCS3200D Module Detector
Arduino Sensor - Quad Core Custom HC SR04 Ultrasonic Ranging Module Detection Sensor 2cm 500cm for AVR Arduino New Arduino Ultrasonic Module HC SR04 Distance Sensor Arduino Beagleboard sensors and ... Suporte e Gerenciamento de Redes..:: Speedy Network Internet ... Speedy Network Informtica, Especialistas na Implementao, Servidores Locais e Servidores Internet, Gerenciamento e Manuteno de Redes Locais e Remotas, Redes ... Tudo sobre Games - ZapGames.com.br ZapGames.com.br, Site de contedo exclusivo de entretenimento do mundo dos Games, dicas, emuladores, ajuda.

0 comments:
Post a Comment