1

I'm now trying to connect my Adafruit_STMPE610 resistive touchscreen controller to Raspberry Pi. I have done all the wiring work, but I only find an Arduino code for the touch test.

Is there any test code for Raspberry Pi? I'm pretty new to this so I don't really know how to write my own code. I know how to use GPIO on RPi and maybe that helps?

Thanks for any help!

2

The real meat of that is in Adafruit_STMPE610.cpp and the corresponding header. You would have to understand C or C++ to translate that for the pi. It would not be that hard, but it is certainly over the head of a complete beginner. If you started learning C++ now, in a few months you would be able do it.

I guess this is something you should have thought of before you bought it. It is 3.3 V with I2C and SPI interfaces and could be used on a pi, but that is a DIY, primarily programming, project. The soldering and physical assembly is in reach of a complete beginner, but the software side is a little more complicated.

If you are intending to learn to code, this is not so bad. Just put it in a drawer for a while. If you don't want to learn C++ in particular, don't worry too much. Most contemporary languages owe much of their syntax to C, and so if you learn something else, you should be able to glean enough from that to translate it into something else (a few well thought out and specific questions on Stack Overflow may eventually help, but please, do not bother trying that now -- you cannot do this yet and will only waste your and other people's time trying). C++ is a relatively difficult language to learn, but, at least in this case, not so hard to read for relevant details.1 Python is probably the ideal general purpose language for a beginner on the pi, since it has more libraries and examples for using the GPIO pins. Perl and Ruby are similar (these are all dynamically typed, interpreted, and object oriented, with a fundamentally C like syntax) but have less pi-specific support.


1. Those details mostly come from the chip manufacturer's data sheet; I say "mostly" because there may be some derived from the Adafruit breakout. Data sheets are pretty abstract from a programming perspective and it is nice to have examples such as this so you can see how they correspond to existing code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.