- -43%
TCS3200D/TCS230 színfelismerő érzékelő modul, színérzékelő modul
TCS3200D/TCS230 színfelismerő érzékelő modul, színérzékelő modul
716 Ft
43% megtakarítás
1 256 Ft
Nincs adó
1. Onboard TCS3200 color sensor
2. Support 3V-5V voltage input
3. All the pins of the chip have been led out, and the pins are standard 100mil (2.54mm), which is convenient for dot matrix board
4. PCB size: 31.6(mm)x24.4(mm)
The simple test procedure is as follows:
#include
#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 are the modes for setting the filter
sbit S3=P1^4;
sbit OE=P1^2; //Enable
void RS232_init()
{
TMOD=0X20; //Timer 1 works in mode 1
SCON=0x50;
PCON=0X80; //
TH1=TL1=0XFF;//22.1184M crystal oscillator, the baud rate is set to 115200
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 time,a;
a=m;
TMOD=0x61; //Counter 1, Timer 0 works in 16-bit mode
TH0=TL0=0; //Start counting 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);
2. Support 3V-5V voltage input
3. All the pins of the chip have been led out, and the pins are standard 100mil (2.54mm), which is convenient for dot matrix board
4. PCB size: 31.6(mm)x24.4(mm)
The simple test procedure is as follows:
#include
#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 are the modes for setting the filter
sbit S3=P1^4;
sbit OE=P1^2; //Enable
void RS232_init()
{
TMOD=0X20; //Timer 1 works in mode 1
SCON=0x50;
PCON=0X80; //
TH1=TL1=0XFF;//22.1184M crystal oscillator, the baud rate is set to 115200
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 time,a;
a=m;
TMOD=0x61; //Counter 1, Timer 0 works in 16-bit mode
TH0=TL0=0; //Start counting 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);
Biztonsági feltételek
Szállításii feltételek
Visszaküldési feltételek