Giter Site home page Giter Site logo

arduino8229bfskeypad's Introduction

一、电路连接

请添加图片描述 学校发的Arduino实验盒里还有个矩阵键盘,一开始看到了SDA和SCL感觉是IIC驱动的,但是去Arduino官方论坛看了看,发现好像那个是SDO?,他并不是IIC驱动的,后来从Github上找了一个能用的库

矩阵键盘引脚 Arduino引脚
V 5V
G GND
SDO 9
SCL 8

二、代码

先要下载一个TTP229的库 TTP229

#include "TTP229.h"
 
TTP229 ttp229(8,9);
uint8_t TouchPadKeyValue = 0;
 
void setup(){
  Serial.begin(115200);
}
 
void loop(){
  TouchPadKeyValue = ttp229.ReadKey16();
 
  if (TouchPadKeyValue == 1) {
    Serial.println("1");
 
  } else if (TouchPadKeyValue == 2) {
    Serial.println("2");
  } else if (TouchPadKeyValue == 3) {
    Serial.println("3");
  } else if (TouchPadKeyValue == 4) {
    Serial.println("A");
  } else if (TouchPadKeyValue == 5) {
    Serial.println("4");
  } else if (TouchPadKeyValue == 6) {
    Serial.println("5");
  } else if (TouchPadKeyValue == 7) {
    Serial.println("6");
  } else if (TouchPadKeyValue == 8) {
    Serial.println("B");
  } else if (TouchPadKeyValue == 9) {
    Serial.println("7");
  } else if (TouchPadKeyValue == 10) {
    Serial.println("8");
  } else if (TouchPadKeyValue == 11) {
    Serial.println("9");
  } else if (TouchPadKeyValue == 12) {
    Serial.println("C");
  } else if (TouchPadKeyValue == 13) {
    Serial.println("*");
  } else if (TouchPadKeyValue == 14) {
    Serial.println("0");
  } else if (TouchPadKeyValue == 15) {
    Serial.println("#");
  } else if (TouchPadKeyValue == 16) {
    Serial.println("D");
  } else if (false) {
  }
 
}

三、效果

在这里插入图片描述 可能是这个触摸的原因,误触率实在太高了,根本就没法使用

arduino8229bfskeypad's People

Contributors

mengfanjun020906 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.