TTP226 module touch panel serial mode library for Mysensors?
-
Re: How To: Make a Simple/Cheap Scene Controller (with video)
Do we have any serial mode library?
-
@vikasjee no need for a library there. The thread contains an example for using the TTP226.
-
@AWI I need to use the Serial Mode ( 2 pins ) in TTP226 module instead of Direct Mode which requires ( 9 pins) on Arduino with Interrupt enabled on 8 inputs. Hence the request for the Serial Mode TTP226 library
-
@vikasjee sorry I forgot to attach the link to the thread where the serial interface is used. This piece of code is sufficient:
// fetch serial data, store in keyState int fetchData(){ digitalWrite(SCL_pin, LOW); // get first bit delayMicroseconds(100); // allow for stable input digitalWrite(SCL_pin, HIGH); for(int i = 0; i < keyboardSize; i++){ // read all keys keyState[i] = (digitalRead(SDA_pin) == LOW) ; // set key if pressed digitalWrite(SCL_pin, LOW); // get first bit delayMicroseconds(100); // allow for stable input digitalWrite(SCL_pin, HIGH); delayMicroseconds(100); } }
-
@AWI Thanks for the piece of code. Now i can see where i was wrong! Let me run it... this seems to be missing the interrupt part though. I will try using DV on Int2...