Created
June 12, 2018 15:00
-
-
Save HectorTorres/483ad514e296de5dfdf170e44ab3bf32 to your computer and use it in GitHub Desktop.
TTP229 serial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <TTP229.h> //Libreria necesaria para que el arduino reconozca el dispositivo | |
const int SCL_PIN = 2; // El reloj se conecta al PIN 2 del Arduino | |
const int SDO_PIN = 3; // El SDO se conecta al PIN 3 del Arduino | |
TTP229 ttp229(SCL_PIN, SDO_PIN); | |
void setup() | |
{ | |
Serial.begin(115200); | |
Serial.println("Presione una tecla a la vez"); | |
} | |
void loop() | |
{ | |
uint8_t tec = ttp229.ReadKey16(); //Se lee la tecla presionada | |
if (tec) Serial.println(tec); //Se imprime en el Monitor serial | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment