Ks0210 keyestudio RPI TTP229L 16-key Capacitive Touch Keypad: Difference between revisions
Keyestudio (talk | contribs) No edit summary |
Keyestudio (talk | contribs) |
||
(17 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<br> | |||
==Introduction== | ==Introduction== | ||
This keypad is designed for Raspberry Pi and supplies your Pi with 16 keys. It has an I2C communication mode and uses 3.3 V supply voltage with a power indicator. We provide you with installation package, source codes and a document | This keypad is designed for Raspberry Pi and supplies your Pi with 16 keys. It has an I2C communication mode and uses 3.3 V supply voltage with a power indicator. <br> | ||
We provide you with installation package, source codes and a document to help you complete your programs.<br> | |||
<br>[[File:Ks0210-11.png|500px|frameless|thumb]]<br> | |||
<br> | |||
==Specification== | ==Specification== | ||
Line 9: | Line 13: | ||
* Supply Voltage: 3.3V | * Supply Voltage: 3.3V | ||
* Interface: I2C | * Interface: I2C | ||
* | |||
<br> | |||
== Shipping List == | |||
* keyestudio RPI TTP229L 16-key Capacitive Touch Keypad x1 | |||
* M2.5*6MM screw x 6 | |||
* M2.5*19MM copper pillar x 3 | |||
<br>[[File:Ks0210-12.png|600px|frameless|thumb]]<br> | |||
<br> | |||
==Connection Diagram == | ==Connection Diagram == | ||
Plug it directly into Raspberry Pi to start your works as shown in below figure. After power-on have about 0.5sec stable-time. During the time do not touch the key pad, and all functions are disabled. | Plug it directly into Raspberry Pi to start your works as shown in below figure.<br> After power-on have about 0.5sec stable-time. During the time do not touch the key pad, and all functions are disabled. | ||
<br>[[File: | <br>[[File:Ks0210-13.png|500px|frameless|thumb]]<br> | ||
<br> | |||
==Sample Code== | ==Sample Code== | ||
<pre> | <pre> | ||
Line 51: | Line 66: | ||
</pre> | </pre> | ||
<br> | |||
==Program Writing== | |||
===1.Installing bcm-2835 Library=== | |||
Here is the tutorial for installing bcm-2835 library in Raspberry Pi. To install bcm-2835, first we need to download bcm2835 library. So we will provide an installation package or click its official web http://www.airspayce.com/mikem/bcm2835/ to download it. <br> | |||
'''Step1:''' Now after downloading library, copy it in any folder of your raspberry pi by winSCP(we provide its installation package, but please refer to usage by yourselves). <br> | |||
'''Step2:''' Now it’s time to extract the library, so open terminal of raspberry pi and go to the folder where you have copied your library and type this command: '''tar zxvf bcm2835-1.26.tar.gz''' <br> | |||
'''Step3:''' Now to into library folder, type this command: '''cd bcm2835-1.26''' <br> | |||
'''Step4:''' Now, we are ready to install bcm2835 library, so to start installation type this command: '''./configure''' <br> | |||
'''Step5:''' then type this command: '''make''' <br> | |||
'''Step6:''' then this: '''sudo make check''' <br> | |||
'''Step7:'''and finally this: '''sudo make install''' <br> | |||
Congrats your library is installed. Now use “#include <bcm2835.h>” in your program to use bcm2835 library.<br> | Congrats your library is installed. Now use “#include <bcm2835.h>” in your program to use bcm2835 library.<br> | ||
<br> | |||
===2.Programming=== | ===2.Programming=== | ||
Now | Now it's time to write a program. If you need to create a new directory within raspberry pi, you can use the ‘mkdir’ command. So type at your terminal: '''mkdir rpi_shield''' <br> | ||
then copy the file rpi_TTP229L provided by us and put it into the directory rpi_shield through winSCP. Next , type this command: | then copy the file '''rpi_TTP229L''' provided by us and put it into the directory rpi_shield through winSCP. Next, type this command: c'''d rpi_TTP229L''' to go inside the rpi_TTP229L folder. <br> | ||
<br>[[File:ks0210-3.png| | Then type this command: '''make''' to make an executable file; This means this is the file we run to launch the program as shown in below figure.<br> | ||
To make a new directory, you just need to add the name of the directory after the command, such as 'mkdir new_directory'.<br> | |||
<br>[[File:ks0210-4.png| | Finally type this: '''sudo ./TTP229''' to launch the program. <br> | ||
sudo ./TTP229 to running program | <br>[[File:ks0210-3.png|700px|frameless|thumb]]<br> | ||
<br>[[File:ks0210-5.png| | <br> | ||
<br> | |||
== Result == | |||
Touch the keys, and corresponding value is printed on the terminal as shown in below figure. <br> | |||
Use '''Ctrl+C''' to exit the processing program.<br> | |||
<br>[[File:ks0210-4.png|700px|frameless|thumb]]<br> | |||
'''sudo ./TTP229''' to running program | |||
<br>[[File:ks0210-5.png|700px|frameless|thumb]]<br> | |||
<br> | |||
Touching different keys to print various value | Touching different keys to print various value | ||
[[ | <br> | ||
== Documents== | |||
* '''Libraries and test code :''' <br> | |||
https://fs.keyestudio.com/KS0210 | |||
<br> | |||
== Get One Now == | |||
*[https://www.keyestudio.com/keyestudio-rpi-ttp229l-16-channel-touch-shield-for-raspberry-pi-ce-certification-p0473-p0473.html '''Official website''' ] | |||
*[https://www.aliexpress.com/store/product/Keyestudio-RPI-TTP229L-16-channel-Touch-shield-for-Raspberry-Pi/1452162_32779485623.html?spm=2114.12010612.8148356.21.4ae46485CwvPRi '''Aliexpress store''' ] | |||
[[Category:Raspberry Pi]] |
Latest revision as of 16:05, 3 March 2021
Introduction
This keypad is designed for Raspberry Pi and supplies your Pi with 16 keys. It has an I2C communication mode and uses 3.3 V supply voltage with a power indicator.
We provide you with installation package, source codes and a document to help you complete your programs.
Specification
- Chip: TTP229-LSF
- Supply Voltage: 3.3V
- Interface: I2C
Shipping List
- keyestudio RPI TTP229L 16-key Capacitive Touch Keypad x1
- M2.5*6MM screw x 6
- M2.5*19MM copper pillar x 3
Connection Diagram
Plug it directly into Raspberry Pi to start your works as shown in below figure.
After power-on have about 0.5sec stable-time. During the time do not touch the key pad, and all functions are disabled.
Sample Code
#include <bcm2835.h> #include <stdio.h> #include <unistd.h> unsigned char WriteBuf; unsigned char WriteBuf1; unsigned int ReadBuf0; int main(int argc, char **argv) { if (!bcm2835_init()) return 1; bcm2835_i2c_begin(); bcm2835_i2c_setSlaveAddress(0x57); bcm2835_i2c_set_baudrate(10000); printf("start..........\n"); while(1) { WriteBuf = 0x00; bcm2835_i2c_write_read_rs(&WriteBuf,2,&WriteBuf1,2); bcm2835_i2c_read (&ReadBuf0,2); printf("TTP229:%d\n",ReadBuf0); printf ("\r"); fflush (stdout); bcm2835_delay(100); } bcm2835_i2c_end(); bcm2835_close(); return 0; }
Program Writing
1.Installing bcm-2835 Library
Here is the tutorial for installing bcm-2835 library in Raspberry Pi. To install bcm-2835, first we need to download bcm2835 library. So we will provide an installation package or click its official web http://www.airspayce.com/mikem/bcm2835/ to download it.
Step1: Now after downloading library, copy it in any folder of your raspberry pi by winSCP(we provide its installation package, but please refer to usage by yourselves).
Step2: Now it’s time to extract the library, so open terminal of raspberry pi and go to the folder where you have copied your library and type this command: tar zxvf bcm2835-1.26.tar.gz
Step3: Now to into library folder, type this command: cd bcm2835-1.26
Step4: Now, we are ready to install bcm2835 library, so to start installation type this command: ./configure
Step5: then type this command: make
Step6: then this: sudo make check
Step7:and finally this: sudo make install
Congrats your library is installed. Now use “#include <bcm2835.h>” in your program to use bcm2835 library.
2.Programming
Now it's time to write a program. If you need to create a new directory within raspberry pi, you can use the ‘mkdir’ command. So type at your terminal: mkdir rpi_shield
then copy the file rpi_TTP229L provided by us and put it into the directory rpi_shield through winSCP. Next, type this command: cd rpi_TTP229L to go inside the rpi_TTP229L folder.
Then type this command: make to make an executable file; This means this is the file we run to launch the program as shown in below figure.
To make a new directory, you just need to add the name of the directory after the command, such as 'mkdir new_directory'.
Finally type this: sudo ./TTP229 to launch the program.
Result
Touch the keys, and corresponding value is printed on the terminal as shown in below figure.
Use Ctrl+C to exit the processing program.
sudo ./TTP229 to running program
Touching different keys to print various value
Documents
- Libraries and test code :
https://fs.keyestudio.com/KS0210