Danh sách sản phẩm

Bàn phím cảm ứng 4 chạm điện dung TTP224

Mã sản phẩm: IMA290   |   Tình trạng: Còn 17 sản phẩm có sẵn
16.000₫
  • Nhập IMA-90 giảm 90%, tối đa 2K
  • Nhập IMA-5K giảm 5k, đơn từ 199K
  • Nhập IMA-35K giảm 35k, đơn từ 499K

Mô tả sản phẩm

Bàn phím cảm ứng 4 chạm điện dung TTP224 được sử dụng để làm bàn phím, công tắc cảm ứng điện dung, công tắc ẩn,..., với khả năng có thể nhận biết điện dung từ tay người qua 4 vị trí cảm ứng với độ nhạy cao, bàn phím phù hợp với các ứng dụng cần độ bền, tạo sự độc đáo và chuyên nghiệp trong các ứng dụng điều khiển cảm ứng.

Thông số kỹ thuật:

  • IC chính: TTP224
  • Điện áp làm việc: 2.4~5.5VDC
  • Dòng điện tiêu thụ: < 10uA
  • 4 phím cảm ứng điện dung, tín hiệu tương ứng với 4 ngõ ra.
  • Có các chân Jumper thiết lập các chế độ chuyên sâu.
  • Kích thước: 35 x 29mm

Sơ đồ chân:


Code tham khảo Arduino: 

/* This code works with 4 channel Capacitive touch buttons module or 4 buttons/switches and a RGB LED
 * It controls the colors values of a RGB LED and displays the current values on the serial monitor
 * Refer to www.SurtrTech.com for more details
 */

#define Button1 2 //Buttons pins
#define Button2 3
#define Button3 4
#define Button4 5

#define LED_R 9   //RGB pins they should be pwm
#define LED_G 10
#define LED_B 11

int Red=0, Blue=0, Green=0; //Color values to be affected to the RGB

bool Button1_State, Button2_State, Button3_State, Button4_State; //Store the buttons states


void setup() {
  
  Serial.begin(9600);        //Set Serial communication
  
  pinMode(Button1,INPUT);    //Set pin modes
  pinMode(Button2,INPUT);
  pinMode(Button3,INPUT);
  pinMode(Button4,INPUT);

  pinMode(LED_R,OUTPUT);     
  pinMode(LED_G,OUTPUT);
  pinMode(LED_B,OUTPUT);
  
}

void loop() {

  Serial.print(Red);     //Display the colors values on the serial monitor
  Serial.print("\t");
  Serial.print(Green);
  Serial.print("\t");
  Serial.println(Blue);
  
  
  Button1_State = digitalRead(Button1); //Read the buttons states
  Button2_State = digitalRead(Button2);
  Button3_State = digitalRead(Button3);
  Button4_State = digitalRead(Button4);

  analogWrite(LED_R,Red);       //Write the values on the RGB
  analogWrite(LED_G,Green);
  analogWrite(LED_B,Blue);

  if(Button1_State == HIGH)   //Button 1 controls the RED, 2 Green and 3 Blue
     Red+= 20;                //Everytime you press the value gets incremented by 20 you can change as you want
  if(Red >= 255)              //If it exceeds the limit it will be brought back to 0
     Red=0;

   if(Button2_State == HIGH)
   Green+= 20;
  if(Green >= 255)
   Green=0;

   if(Button3_State == HIGH)
   Blue+= 20;
   if(Blue >= 255)
   Blue=0;

   if(Button4_State == HIGH){ //Button 4 resets the value to 0
    
    Red=0;
    Green=0;
    Blue=0;
    
   }
  delay(100); //To avoid that one touch gets counted as 10 or more, although 100 is pretty big you can reduce it and test
}

Video tham khảo:


 

Khách hàng nhận xét