GY-31/GY-33 TCS34725 with Wide-Angle Lens TCS3200D/TCS230 Color Identification Sensor
SPECIFICATIONS
Application: standard
Brand Name: PENGHEKEJI
Choice: yes
Condition: New
Dissipation Power: standard
High-concerned chemical: none
Operating Temperature: standard
Origin: Mainland China
Supply Voltage: standard
Type: Module
is_customized: Yes
semi_Choice: yes
7, PCB size: (L) 33mm * (W) 25mm
The simple test program is as follows:
#include<reg52.h
#define uchar unsigned char
#define uint unsigned int
sbit S0=P1^0; //S0,S1 is to set the duty cycle of the output.
sbit S1=P1^1.
sbit S2=P1^3; //S2,S3 is to set the mode of light consideration
sbit S3=P1^4; sbit OE=P1^4; //S2,S3 is to set the mode of light consideration.
sbit OE=P1^2; //Enable
void RS232_init()
{
TMOD=0X20; //Timer1 working in mode 1
SCON=0x50.
PCON=0X80; //
TH1=TL1=0XFF;//22.1184M crystal, baud rate set to 115200
TR1=1.
TR1=1; TI=0.
RI=0.
}
void send_char(uchar a) // send data
{
SBUF=a;
while(TI==0);
TI=0;
}
uchar get_char() //receive data
{
while(RI==0);
RI=0;
Return SBUF;
}
uint color_display(uchar m)
uint color_display(uchar m)
uint time,a.
a=m.
TMOD=0x61; //counter 1, timer 0 works in 16-bit mode
TH0=TL0=0; //count from zero, timing
TH1=TL1=0.
S0=1.
S1=1.
S2=m&0x01.
S3=m&0x02.
OE=0.
TR0=TR1=1.
while(TL1<250);
TR1=TR0=0.
OE=1.
time=TH0*256+TL0.
return(time);
}
void main()
{
uint temp;
RS232_init();
OE=1;
while(1)
{
temp=color_display(get_char());
RS232_init();
send_char(temp/1000);
send_char(temp%1000/100);
send_char(temp%100/10);
send_char(temp%10);
}
}
The serial port is used to select the channel for the color type, and then the different colors are determined because they correspond to different times (with the same counting values).











- Standard Shipping: Standard Shipping (12–18 Business Days)
- Express Shipping: Expedited Shipping (5–9 Business Days)
- Free Shipping: Orders over $199 qualify automatically
- Tracking: Full tracking number provided for all orders
- Returns: 30-day hassle-free return window
- Condition: Items must be unused and in original packaging
- Refund: Full refund processed within 3-5 business days
- Factory Direct: ISO/TS 16949 certified manufacturer
- Quality: 100% electrical continuity tested before shipment
- Experience: 15+ years in automotive connector industry
- Support: Professional technical support available
You may also like
Blog posts
Title
Subscribe to our emails
Be the first to know about new collections and special offers.