toxicmouse
Senior Member
This is an easy to use, low cost Touch Panel that interfaces directly with a picaxe chip over i2c.
Touch Panel:
IQS550-TS43 S
Azoteq LCD Touch Panels
http://uk.mouser.com/ProductDetail/Azoteq/IQS550-TS43-S/?qs=ewP3geARmfToshljzAtafQ==
GBP 15 each, including controller for the 4.3" version.
I used a picaxe 20M2 but this should work with any i2c capable picaxe.
3.3v power from a LD1117AV33
Touch Panel:
IQS550-TS43 S
Azoteq LCD Touch Panels
http://uk.mouser.com/ProductDetail/Azoteq/IQS550-TS43-S/?qs=ewP3geARmfToshljzAtafQ==
GBP 15 each, including controller for the 4.3" version.
I used a picaxe 20M2 but this should work with any i2c capable picaxe.
3.3v power from a LD1117AV33
Code:
'Touchscreen basic command
'oct 2015, tested WORKS
'written by toxicmouse
'using Azoteq.com ProxSense® IQS550-TS43 Projected Capacitive Touchscreen Multi-touch Sensor and Controller for 4.3" LCD displays
symbol nrst = b.4 'the NRST must be kept low during set up. this calibrates the touchscreen. otherwise keep high.
symbol ready = b.6 'when the touchscreen is ready to send it will send this pin low then high. Can use as interrupt.
'initi
low nrst 'calibrate touchscreen
pause 50' not sure on the minimum pause for this but 50 works nicely.
high nrst 'end calibrate touchscreen
hi2csetup i2cmaster, %11101000, i2cfast, i2cbyte 'initialise the screen as a slave and picaxe as the master
main:
hi2cin 1,(b0,b1,b3,b2,b5,b4,b7,b6,b8)'read from address 1 only.
'hi2cin 1,(b0,b1,b3,b2,b5,b4,b7,b6,b8,b9,b10,b11,b12,b13...etc)'read from address 1 to get the first, second, third, etc touches .
if b0 = 129 then 'if there is 1 touch this will be 129. If there are 2 touches then this will be 130, 3 touches 131, etc.
{
sertxd ("ID:",#b1," x= ",#w2," - y=",#w1," strength: ",#w3,cr,lf)
}
endif
goto main
Attachments
-
56 KB Views: 48