Coder Social home page Coder Social logo

xpt2046's Introduction

XPT2046

Arduino library for XPT2046 / ADS7843 touchscreen driver.

XPT on ESP video

Although there are a couple of libraries for this chip out there (e.g., UTouch and elechouse/touch), both of them used bitbanging (rather than hardware SPI) and neither of them supported differential mode. However, on the ESP8266, unless the SPI bus is shared, there aren't enough pins for both the LCD and the touchscreen. Hardware SPI is also much faster, thus strongly preferred for the LCD. This was the initial motivation but, while at it, I also added differential mode support.

My implementation is based on TI's technical note and TI's datasheet. It has been tested on an XPT2046 (which is a clone), connected to an ESP8266 (Sparkfun Thing).

The examples require Ucglib, but it should be easy to rewrite them for a library of your choice. Either way, you will also need to edit the parameters in the examples to match your setup.

Caveats:

  • Single-ended mode is completely untested, although there is a relevant argument in getPosition(); if current draw is low, I may remove the option altogether
  • Does not support SPI transactions (and neither does Ucglib), so if you're sharing the bus, you should be careful! It so happens that parameters good for Ucglib on an ILI9431 are also good for this chip; YMMV.
  • I'm not sure if all display modules have different touchscreen and LCD coordinates; mine did, and the code has been tested only for that configuration.

xpt2046's People

Contributors

spapadim avatar

Watchers

James Cloos avatar Dean 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.