Skip to content

Instantly share code, notes, and snippets.

@HectorTorres
Created June 12, 2018 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HectorTorres/483ad514e296de5dfdf170e44ab3bf32 to your computer and use it in GitHub Desktop.
Save HectorTorres/483ad514e296de5dfdf170e44ab3bf32 to your computer and use it in GitHub Desktop.
TTP229 serial
#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