{"id":269729,"date":"2015-12-07T00:57:02","date_gmt":"2015-12-06T21:57:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=269729"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=269729","title":{"rendered":"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0444\u0438\u0441\u043d\u044b\u043c \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u043f\u043e Wi-Fi. \u0427\u0430\u0441\u0442\u044c 2: \u0421\u0435\u043d\u0441\u043e\u0440\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f Q-touch"},"content":{"rendered":"<p>       \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043d\u0430\u0448 \u0430\u043c\u0431\u0438\u0446\u0438\u043e\u0437\u043d\u044b\u0439 \u00abHello, World!\u00bb \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 Atmel SAMD21 Xplained, \u0437\u0430\u0442\u0435\u044f\u043d\u043d\u044b\u0439 \u0432 <a href=\"http:\/\/geektimes.ru\/company\/rainbow\/blog\/266368\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Wi-Fi \u043c\u043e\u0434\u0443\u043b\u0435\u043c WINC1500.<br \/>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Q-touch. <br \/>  <iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/n-qHjWmsnro?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><br \/>  \u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0446\u0438\u043a\u043b\u0430, \u043a\u0430\u043a \u0438 \u0431\u044b\u043b\u043e \u043e\u0431\u0435\u0449\u0430\u043d\u043e, \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u044d\u0442\u0438\u0445 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u00ab\u0437\u0430\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f\u00bb \u0432 \u043f\u043e\u0441\u044b\u043b\u043a\u0443 ModBus TCP \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e Wi-Fi \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043e\u0444\u0438\u0441\u0435.<a name=\"habracut\"><\/a><\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0447\u0442\u043e \u0436\u0435 \u044d\u0442\u043e \u0437\u0430 Q-touch. \u042d\u0442\u043e \u0430\u0442\u043c\u0435\u043b\u043e\u0432\u0441\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0445 \u0440\u0435\u0437\u0438\u0441\u0442\u0438\u0432\u043d\u044b\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u043e\u0432, \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u043c\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438. \u041f\u0440\u0438\u0447\u0435\u043c \u0432\u043e \u0432\u0441\u0435\u0445 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 SAMD \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 Q-touch (\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0439\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u0439 (PTC)). \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0432\u043e\u0434\u043e\u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0442\u0430\u043a \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u044f\u0434\u0440\u043e.<br \/>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <a href=\"http:\/\/www.atmel.com\/tools\/ATQT1-XPRO.aspx\">ATQT1-XPRO<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043a\u0430\u043a \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0443 \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 Xplained Pro.<br \/>  \u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f Qtouch \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0438\u0434\u044b \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432: \u043a\u043d\u043e\u043f\u043a\u0438, \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u044b, \u0440\u043e\u0442\u043e\u0440\u044b \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f (proximity).<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4da\/9c4\/df3\/4da9c4df378946669da6e28a386f7951.png\"\/><\/p>\n<h4>\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 Qtouch \u0438 QMatrix <\/h4>\n<p>  QTouch \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0435\u043c\u043a\u043e\u0441\u0442\u0438, \u0430 QMatrix \u043d\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439.<br \/>  \u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0435\u043c\u043a\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u0437\u0430\u0440\u044f\u0434 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u0434\u0430 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u0435\u043c\u043a\u043e\u0441\u0442\u0438 \u0434\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u0430. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u0440\u044f\u0434 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043f\u044c. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0446\u0438\u043a\u043b\u043e\u0432 \u0437\u0430\u0440\u044f\u0434\u0430-\u0438-\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u0435\u043c\u043a\u043e\u0441\u0442\u044c \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u043b\u0430\u0441\u0442\u0438\u043d\u044b.<br \/>  \u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0435\u043c\u043a\u043e\u0441\u0442\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u0443\u0445 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u0434\u043e\u0432. \u041e\u0434\u0438\u043d \u0438\u0437 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u0434\u043e\u0432 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044d\u043c\u0438\u0442\u0442\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u0430\u0440\u044f\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0438\u043c\u043f\u0443\u043b\u044c\u0441\u0430\u043c\u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c (burst) \u0440\u0435\u0436\u0438\u043c\u0435. \u0412\u0442\u043e\u0440\u043e\u0439 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u0434 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u044d\u043c\u0438\u0442\u0442\u0435\u0440\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u044d\u043b\u0435\u043a\u0442\u0440\u0438\u043a, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u0442\u0430\u0447-\u043f\u0430\u043d\u0435\u043b\u044c. \u041a\u043e\u0433\u0434\u0430 \u043f\u0430\u043b\u0435\u0446 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u043d\u0435\u043b\u0438, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f, \u0438 \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f.   <\/p>\n<table>\n<tr>\n<th>Qtouch<\/th>\n<th> QMatrix<\/th>\n<\/tr>\n<tr>\n<td>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0435\u043c\u043a\u043e\u0441\u0442\u044c<\/td>\n<td> \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430\u044f \u0435\u043c\u043a\u043e\u0441\u0442\u044c<\/td>\n<\/tr>\n<tr>\n<td>\u041d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0434\u0438\u0437\u0430\u0439\u043d \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u0434\u043e\u0432<\/td>\n<td>\u0425\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u044f<\/td>\n<\/tr>\n<tr>\n<td>\u0418\u0434\u0435\u0430\u043b\u044c\u043d\u0430 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432<\/td>\n<td> \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 (\u0431\u043e\u043b\u044c\u0448\u0435 10)<\/td>\n<\/tr>\n<tr>\n<td>\u0425\u043e\u0440\u043e\u0448\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f, \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438<\/td>\n<td> \u0425\u043e\u0440\u043e\u0448\u043e \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u0430\u0431\u043b\u0438\u0432\u0430\u044e\u0449\u0430\u044f\u0441\u044f \u043a \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0439 \u0441\u0440\u0435\u0434\u0435<\/td>\n<\/tr>\n<tr>\n<td>\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u043b\u044e\u0431\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u0434\u0430<\/td>\n<td> \u041f\u0430\u0441\u0441\u0438\u0432\u043d\u043e\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u2013 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u043f\u0443\u0442\u0438<\/td>\n<\/tr>\n<tr>\n<td>\u041b\u0435\u0433\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/td>\n<td> \u0425\u043e\u0440\u043e\u0448\u043e \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u0430\u0431\u043b\u0438\u0432\u0430\u044e\u0449\u0430\u044f\u0441\u044f \u043a \u0448\u0443\u043c\u0443 \u0438 \u043d\u0430\u0432\u043e\u0434\u043a\u0430\u043c \u043f\u043e \u0437\u0435\u043c\u043b\u0435<\/td>\n<\/tr>\n<\/table>\n<p>  \u0412 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0441\u0435\u0440\u0438\u0438 SAMD20 \u0438 21 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f QTouch\/QMatrix \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430. \u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u043b\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430 \u043d\u0435\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u2013 \u044d\u0442\u043e \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0439\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u0439 (PTC). \u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435.<br \/>   <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f95\/fcd\/433\/f95fcd433f2c47dead136911ad041cfa.png\"\/>  <\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442<\/h4>\n<p>  \u0414\u043b\u044f \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438-\u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438. \u0410 \u0434\u043b\u044f QTouch \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d QTouch Composer, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0439. \u041d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u0434\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0441\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u0438\u043c \u0438 \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f.<br \/>  \u041e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u043d\u0430 \u0431\u043b\u043e\u043a \u0441\u0445\u0435\u043c\u0435:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/def\/421\/503\/def421503fe9446ca0a9405f81245107.png\"\/><br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0438\u0437\u0430\u0440\u0434\u0430 PTC \u0438 RTC.<\/p>\n<p>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 touch_config_samd.h. \u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c.<br \/>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u0439: \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0435\u043c\u043a\u043e\u0441\u0442\u044c \u0438\u043b\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430\u044f. \u0412\u044b\u0431\u043e\u0440 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442.   <\/p>\n<pre><code class=\"cpp\">#define DEF_TOUCH_MUTLCAP               (1u) #define DEF_TOUCH_SELFCAP               (0u) <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u043e\u0442 PTC \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0442 0 \u0434\u043e 3 (0 \u0441\u0430\u043c\u044b\u0439 \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442). \u0418 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0435\u0444\u0430\u0439\u043d\u0430:  <\/p>\n<pre><code class=\"cpp\">#define DEF_TOUCH_PTC_ISR_LVL   (1u) <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435, \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0435\u043c\u043a\u043e\u0441\u0442\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0432\u0435 \u043b\u0438\u043d\u0438\u0438: X \u0438 Y. \u0423 samd21 16 \u043b\u0438\u043d\u0438\u0439 X \u0438 Y. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0441 \u043f\u043b\u0430\u0442\u043e\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f) \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u0432\u044b\u0431\u043e\u0440\u0430 \u043d\u0430 \u043a\u0430\u043a\u0443\u044e \u043f\u0430\u0440\u0443 \u043b\u0438\u043d\u0438\u0439 \u043a\u0430\u043a\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443\/\u0441\u043b\u0430\u0439\u0434\u0435\u0440\/\u0440\u043e\u0442\u043e\u0440 \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u044c. \u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u0430\u0440 \u0432\u044b\u0432\u043e\u0434\u043e\u0432 \u0437\u0430\u0434\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440\u0430 \u043a\u0430\u043d\u0430\u043b\u043e\u0432. \u0414\u043b\u044f \u0440\u043e\u0442\u043e\u0440\u0430\/\u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u043b\u0438\u043d\u0438\u044e Y \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u0430\u043d\u0430\u043b\u043e\u0432. \u0423\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043b\u0438\u043d\u0438\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u0435\u0444\u0430\u0439\u043d\u0430:  <\/p>\n<pre><code class=\"cpp\">#define DEF_MUTLCAP_NODES  X(8), Y(10), X(9), Y(10), X(2), Y(12), X(3), Y(12), \\ \tX(8), Y(12), X(9), Y(12), X(2), Y(13), X(3), Y(13), \\ \tX(8), Y(13), X(9), Y(13) <\/code><\/pre>\n<p>  \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u043d\u0430\u043b\u043e\u0432 (\u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 1 \u043a\u0430\u043d\u0430\u043b, \u0434\u043b\u044f \u0440\u043e\u0442\u043e\u0440\u0430\/\u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \u043e\u0442 3 \u0434\u043e 8). \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f 2 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u043f\u043e 4 \u043a\u0430\u043d\u0430\u043b\u0430 \u043d\u0430 \u0440\u043e\u0442\u043e\u0440 \u0438 \u0441\u043b\u0430\u0439\u0434\u0435\u0440, \u0432\u0441\u0435\u0433\u043e 10 \u043a\u0430\u043d\u0430\u043b\u043e\u0432:  <\/p>\n<pre><code class=\"cpp\">#define DEF_MUTLCAP_NUM_CHANNELS   (10) \/* Total number of channels *\/ <\/code><\/pre>\n<p>  \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 (\u0443 \u043d\u0430\u0441 2 \u043a\u043d\u043e\u043f\u043a\u0438, \u043e\u0434\u0438\u043d \u0441\u043b\u0430\u0439\u0434\u0435\u0440 \u0438 \u043e\u0434\u0438\u043d \u0440\u043e\u0442\u043e\u0440 \u0438\u0442\u043e\u0433\u043e 4):  <\/p>\n<pre><code class=\"cpp\">#define DEF_MUTLCAP_NUM_SENSORS  (4)  \/* Total number of sensors *\/ <\/code><\/pre>\n<p>  \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u043e\u0442\u043e\u0440\u043e\u0432\/\u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 (\u0443 \u043d\u0430\u0441 \u043e\u0434\u0438\u043d \u0441\u043b\u0430\u0439\u0434\u0435\u0440 \u0438 \u043e\u0434\u0438\u043d \u0440\u043e\u0442\u043e\u0440 \u0438\u0442\u043e\u0433\u043e 2):  <\/p>\n<pre><code class=\"cpp\">#define DEF_MUTLCAP_NUM_ROTORS_SLIDERS  (2)  \/* Number of rotor sliders *\/ <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f. <br \/>  \u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0427\u0435\u043c \u0432\u044b\u0448\u0435 \u0443\u0440\u043e\u0432\u0435\u043d\u044c (\u043e\u0442 1 \u0434\u043e 64), \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0435\u043c\u043f\u043b\u043e\u0432 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 1 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0448\u0443\u043c\/\u0441\u0438\u0433\u043d\u0430\u043b, \u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"cpp\">#define DEF_MUTLCAP_FILTER_LEVEL  FILTER_LEVEL_32            \/* Filter level *\/ <\/code><\/pre>\n<p>  \u0423\u0441\u0438\u043b\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0441 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043a\u0430\u043d\u0430\u043b\u044c\u043d\u043e. \u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u0442 1 \u0434\u043e 32.  <\/p>\n<pre><code class=\"cpp\">#define DEF_MUTLCAP_GAIN_PER_NODE  GAIN_1, GAIN_1, GAIN_1, GAIN_1, GAIN_1, \\ \tGAIN_1, GAIN_1, GAIN_1, GAIN_1, GAIN_1 <\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0438\u043e\u0434 \u043e\u043f\u0440\u043e\u0441\u0430 \u0432 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445.  <\/p>\n<pre><code class=\"cpp\">#define DEF_TOUCH_MEASUREMENT_PERIOD_MS 20u <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0438 \u0434\u043b\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043d\u043e\u043f\u043e\u043a, \u0434\u043b\u044f \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439 \u0430\u043d\u0442\u0438\u0434\u0440\u0435\u0431\u0435\u0437\u0433. \u041e\u043d \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u0438 \u0446\u0438\u043a\u043b\u043e\u0432 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u044b\u0439 \u0434\u043b\u044f \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043a \u043a\u043d\u043e\u043f\u043a\u0435\/\u0440\u043e\u0442\u043e\u0440\u0443\/\u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0443.  <\/p>\n<pre><code class=\"cpp\">#define   DEF_MUTLCAP_DI         4u <\/code><\/pre>\n<p>  \u0411\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0434\u043e\u043b\u0433\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u043d\u0441\u043e\u0440\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u043a\u0430\u043b\u0438\u0431\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043d\u0441\u043e\u0440 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u043e\u0432\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u043a\u0430\u043b\u0438\u0431\u0440\u043e\u0432\u043a\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430. \u0412\u0440\u0435\u043c\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u0445 200 \u043c\u0441 (\u0442.\u0435. \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 5 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 1 \u0441\u0435\u043a). \u0415\u0441\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432 0, \u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u043a\u0430\u043b\u0438\u0431\u0440\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.  <\/p>\n<pre><code class=\"cpp\">#define   DEF_MUTLCAP_MAX_ON_DURATION       0u <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0438\u043b\u0438 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043b\u044f Qtouch Analyzer:  <\/p>\n<pre><code class=\"cpp\">&lt;cut \/&gt;#define DEF_TOUCH_QDEBUG_ENABLE 0u <\/code><\/pre>\n<p>  \u041f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0441\u0432\u043e\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c Atmel \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 PTC (\u043a\u0430\u043a \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0435\u0439) \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e \u0432\u0441\u0435 \u043d\u0430\u0434\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u0427\u0435\u043c \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0438 \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f.<br \/>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c RTC, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c RTC, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c callback, \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u0434\u043b\u044f callback. RTC \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437 \u0432 1 \u043c\u0441\u0435\u043a, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0448\u043b\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0441\u0435\u043a, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u043c\u0435\u0436\u0434\u0443 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043d\u043e\u043f\u043e\u043a, \u0442\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u043b\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u0432 main.<br \/>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0430\u0439\u043c\u0435\u0440\u043e\u043c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/ RTC Interrupt timing definition #define TIME_PERIOD_1MSEC 33u  \/* ! QTouch Library Timing info. *\/ touch_time_t touch_time; volatile uint16_t touch_time_counter = 0u; struct rtc_module rtc_instance; \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: void rtc_overflow_callback(void) { \t\/* Do something on RTC overflow here *\/ \tif(touch_time_counter == touch_time.measurement_period_ms) \t{ \t\ttouch_time.time_to_measure_touch = 1u; \t\ttouch_time.current_time_ms = touch_time.current_time_ms + \t\ttouch_time.measurement_period_ms; \t\ttouch_time_counter = 0u; \t} \telse \t{ \t\ttouch_time_counter++; \t} } void configure_rtc_callbacks(void) { \t\/* register callback *\/ \trtc_count_register_callback(&rtc_instance,\trtc_overflow_callback, RTC_COUNT_CALLBACK_OVERFLOW); \t\/* Enable callback *\/ \trtc_count_enable_callback(&rtc_instance,RTC_COUNT_CALLBACK_OVERFLOW); } void configure_rtc_count(void) { \tstruct rtc_count_config config_rtc_count; \trtc_count_get_config_defaults(&config_rtc_count);  \tconfig_rtc_count.prescaler           = RTC_COUNT_PRESCALER_DIV_1; \tconfig_rtc_count.mode                = RTC_COUNT_MODE_16BIT; \tconfig_rtc_count.continuously_update = true; \t\/* initialize rtc *\/ \trtc_count_init(&rtc_instance,RTC,&config_rtc_count);  \t\/* enable rtc *\/ \trtc_count_enable(&rtc_instance); } void timer_init(void) { \t\/* Configure and enable RTC *\/ \tconfigure_rtc_count();  \t\/* Configure and enable callback *\/ \tconfigure_rtc_callbacks();  \t\/* Set Timer Period *\/ \trtc_count_set_period(&rtc_instance,TIME_PERIOD_1MSEC); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0430\u043c PTC. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u043b\u044f PTC<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">static touch_mutlcap_config_t mutlcap_config = { \tDEF_MUTLCAP_NUM_CHANNELS,       \/* Mutual Cap number of channels. *\/ \tDEF_MUTLCAP_NUM_SENSORS,        \/* Mutual Cap number of sensors. *\/ \tDEF_MUTLCAP_NUM_ROTORS_SLIDERS, \/* Mutual Cap number of rotors and sliders. *\/  \t\/* Mutual Cap GLOBAL SENSOR CONFIGURATION INFO. *\/ \t{ \t\tDEF_MUTLCAP_DI,         \/* uint8_t  di; Sensor detect integration (DI) limit. *\/ \t\t\/* Interchanging Negative and Positive Drift rate, since Signal increases on Touch. *\/ \t\tDEF_MUTLCAP_ATCH_DRIFT_RATE, \/* uint8_t  neg_drift_rate; Sensor negative drift rate. *\/ \t\tDEF_MUTLCAP_TCH_DRIFT_RATE, \/* uint8_t  pos_drift_rate; Sensor positive drift rate. *\/ \t\tDEF_MUTLCAP_MAX_ON_DURATION, \/* uint8_t  max_on_duration; Sensor maximum on duration. *\/ \t\tDEF_MUTLCAP_DRIFT_HOLD_TIME, \/* uint8_t  drift_hold_time; Sensor drift hold time. *\/ \t\tDEF_MUTLCAP_ATCH_RECAL_DELAY,   \/* uint8_t  pos_recal_delay; Sensor positive recalibration delay. *\/                 DEF_MUTLCAP_CAL_SEQ1_COUNT,                 DEF_MUTLCAP_CAL_SEQ2_COUNT, \t\tDEF_MUTLCAP_ATCH_RECAL_THRESHOLD, \/* recal_threshold_t recal_threshold; Sensor recalibration threshold. *\/ \t},         { \tmutlcap_gain_per_node,          \/* Mutual Cap channel gain setting. *\/ \tDEF_MUTLCAP_FREQ_MODE, \/* Mutual Cap noise counter measure enable\/disable. *\/         DEF_MUTLCAP_CLK_PRESCALE,         DEF_MUTLCAP_SENSE_RESISTOR,         DEF_MUTLCAP_CC_CAL_CLK_PRESCALE,         DEF_MUTLCAP_CC_CAL_SENSE_RESISTOR,         mutlcap_freq_hops, \tDEF_MUTLCAP_FILTER_LEVEL,       \/* Mutual Cap filter level setting. *\/ \tDEF_MUTLCAP_AUTO_OS,            \/* Mutual Cap auto oversamples setting.*\/\t                                       }, \tmutlcap_data_blk,               \/* Mutual Cap data block index. *\/ \tPRIV_MUTLCAP_DATA_BLK_SIZE, \/* Mutual Cap data block size. *\/ \tmutlcap_xy_nodes,                       \/* Mutual Cap channel nodes. *\/         DEF_MUTLCAP_QUICK_REBURST_ENABLE, \tDEF_MUTLCAP_FILTER_CALLBACK     \/* Mutual Cap filter callback function pointer. *\/ };  touch_config_t touch_config = { \t&mutlcap_config,                \/* Pointer to Mutual Cap configuration structure. *\/ \tNULL, \tDEF_TOUCH_PTC_ISR_LVL,          \/* PTC interrupt level. *\/ }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u0430\u043a\u0440\u043e\u0441\u044b:  <\/p>\n<pre><code class=\"cpp\">#define GET_MUTLCAP_SENSOR_STATE(SENSOR_NUMBER) p_mutlcap_measure_data-&gt; \\ \tp_sensor_states[(SENSOR_NUMBER \/ \\ \t8)] & (1 &lt;&lt; (SENSOR_NUMBER % 8)) <\/code><\/pre>\n<p>  \u0414\u0435\u0444\u0430\u0439\u043d\u044b:  <\/p>\n<pre><code class=\"cpp\">#define   DEF_MUTLCAP_CAL_SEQ1_COUNT            8 #define   DEF_MUTLCAP_CAL_SEQ2_COUNT            4 #define   DEF_MUTLCAP_CC_CAL_CLK_PRESCALE       PRSC_DIV_SEL_8 #define   DEF_MUTLCAP_CC_CAL_SENSE_RESISTOR     RSEL_VAL_100 #define   DEF_MUTLCAP_QUICK_REBURST_ENABLE      1u #define PTC_APBC_BITMASK (1u &lt;&lt; 19u) <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:  <\/p>\n<pre><code class=\"cpp\">static uint8_t mutlcap_data_blk[PRIV_MUTLCAP_DATA_BLK_SIZE];  uint16_t mutlcap_xy_nodes[DEF_MUTLCAP_NUM_CHANNELS * 2] = {DEF_MUTLCAP_NODES};  gain_t mutlcap_gain_per_node[DEF_MUTLCAP_NUM_CHANNELS]= {DEF_MUTLCAP_GAIN_PER_NODE};  freq_hop_sel_t mutlcap_freq_hops[3u]\t= {DEF_MUTLCAP_HOP_FREQS}; <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f PTC:  <\/p>\n<pre><code class=\"cpp\">void touch_configure_ptc_clock(void) { \tstruct system_gclk_chan_config gclk_chan_conf;  \tsystem_gclk_chan_get_config_defaults(&gclk_chan_conf);  \tgclk_chan_conf.source_generator = GCLK_GENERATOR_3;  \tsystem_gclk_chan_set_config(PTC_GCLK_ID, &gclk_chan_conf);  \tsystem_gclk_chan_enable(PTC_GCLK_ID);  \tsystem_apb_clock_set_mask(SYSTEM_CLOCK_APB_APBC, PTC_APBC_BITMASK); } <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432:  <\/p>\n<pre><code class=\"cpp\">touch_ret_t touch_sensors_config(void) { \ttouch_ret_t touch_ret = TOUCH_SUCCESS; \tsensor_id_t sensor_id;  \ttouch_ret = touch_mutlcap_sensor_config(SENSOR_TYPE_KEY, CHANNEL_0, \t\t\tCHANNEL_0, NO_AKS_GROUP, 20u, \t\t\tHYST_6_25, RES_8_BIT,0, \t\t\t&sensor_id); \tif (touch_ret != TOUCH_SUCCESS) while (1); \t\t \t  \ttouch_ret = touch_mutlcap_sensor_config(SENSOR_TYPE_KEY, CHANNEL_1, \t\t\tCHANNEL_1, NO_AKS_GROUP, 20u, \t\t\tHYST_6_25, RES_8_BIT,0, \t\t\t&sensor_id); \tif (touch_ret != TOUCH_SUCCESS) while (1);   \ttouch_ret = touch_mutlcap_sensor_config(SENSOR_TYPE_ROTOR, CHANNEL_6, \t\t\tCHANNEL_9, NO_AKS_GROUP, 20u, \t\t\tHYST_6_25, RES_8_BIT,0, \t\t\t&sensor_id); \tif (touch_ret != TOUCH_SUCCESS) while (1);  \ttouch_ret = touch_mutlcap_sensor_config(SENSOR_TYPE_SLIDER, CHANNEL_2, \t\t\tCHANNEL_5, NO_AKS_GROUP, 20u, \t\t\tHYST_6_25, RES_8_BIT,0, \t\t\t&sensor_id); \tif (touch_ret != TOUCH_SUCCESS) while (1);  \treturn (touch_ret); } <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 \u0438 \u043e\u0431\u0449\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">touch_ret_t touch_sensors_init(void) { \ttouch_ret_t touch_ret = TOUCH_SUCCESS;  \t\/* Setup and enable generic clock source for PTC module. *\/ \ttouch_configure_ptc_clock();  \ttouch_time.measurement_period_ms = DEF_TOUCH_MEASUREMENT_PERIOD_MS;  \t\/* Initialize touch library for Mutual Cap operation. *\/ \ttouch_ret = touch_mutlcap_sensors_init(&touch_config); \tif (touch_ret != TOUCH_SUCCESS)         { \t\twhile (1u);    \/* Check API Error return code. *\/ \t}  #if DEF_TOUCH_QDEBUG_ENABLE == 1 \tQDebug_Init(); #endif  \t\/* configure the touch library sensors. *\/ \ttouch_ret = touch_sensors_config(); \tif (touch_ret != TOUCH_SUCCESS)          { \t\twhile (1u);    \/* Check API Error return code. *\/ \t}  \t\/* Auto Tuning setting for calibration. \t * \t * AUTO_TUNE_PRSC: When Auto tuning of pre-scaler is selected \t * the PTC uses the user defined internal series resistor setting \t * (DEF_MUTLCAP_SENSE_RESISTOR) and the pre-scaler is adjusted \t * to slow down the PTC operation to ensure full charge transfer. \t * \t * AUTO_TUNE_RSEL: When Auto tuning of the series resistor is \t * selected the PTC runs at user defined pre-scaler setting speed \t * (DEF_MUTLCAP_CLK_PRESCALE) and the internal series resistor is \t * tuned automatically to the optimum value to allow for full \t * charge transfer. \t * \t * AUTO_TUNE_NONE: When manual tuning option is selected (AUTO_TUNE_NONE), \t * the user defined values of PTC pre-scaler and series resistor is used \t * for PTC operation as given in DEF_MUTLCAP_CLK_PRESCALE and \t * DEF_MUTLCAP_SENSE_RESISTOR \t * \t *\/ \ttouch_ret = touch_mutlcap_sensors_calibrate(AUTO_TUNE_RSEL); \tif (touch_ret != TOUCH_SUCCESS)          { \t\twhile (1u);    \/* Check API Error return code. *\/ \t}  \treturn (touch_ret); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">void touch_mutlcap_measure_complete_callback( void ) { #if DEF_TOUCH_QDEBUG_ENABLE == 1  \t\/* Send out the Touch debug information data each time when Touch \t *   measurement process is completed . \t *   The Touch Signal and Touch Delta values are always sent. \t *   Touch Status change, Rotor-Slider Position change and Sensor \t * Reference \t *   values can be optionally sent using the masks below. \t *\/ \tQDebug_SendData( TOUCH_CHANNEL_REF_CHANGE | \t\t\tTOUCH_ROTOR_SLIDER_POS_CHANGE | \t\t\tTOUCH_STATUS_CHANGE ); \t\/* QT600 two-way QDebug communication application Example. *\/ \t\/* Process any commands received from QTouch Studio. *\/ \tQDebug_ProcessCommands(); #endif  \tif (!(p_mutlcap_measure_data-&gt;acq_status & TOUCH_BURST_AGAIN))         { \t\t\/* Set the Mutual Cap measurement done flag. *\/ \t\tp_mutlcap_measure_data-&gt;measurement_done_touch = 1u; \t} }  touch_ret_t touch_sensors_measure(void) { \ttouch_ret_t touch_ret = TOUCH_SUCCESS;  \tif (touch_time.time_to_measure_touch == 1u)         { \t\t\/* Start a touch sensors measurement process. *\/  \t\ttouch_ret = touch_mutlcap_sensors_measure( \t\t\t\ttouch_time.current_time_ms, \t\t\t\tNORMAL_ACQ_MODE, \t\t\t\ttouch_mutlcap_measure_complete_callback);  \t\tif ((touch_ret != TOUCH_ACQ_INCOMPLETE) &&\t(touch_ret == TOUCH_SUCCESS))                  { \t\t\ttouch_time.time_to_measure_touch = 0u; \t\t}                 else if ((touch_ret != TOUCH_SUCCESS) &&(touch_ret != TOUCH_ACQ_INCOMPLETE))                { \t\t\twhile (1);  \t\t\t\/* Reaching this point can be due to - \t\t\t *     1. The api has retured an error due to a invalid \t\t\t * input parameter. \t\t\t *     2. The api has been called during a invalid Touch \t\t\t * Library state. *\/ \t\t} \t}  \treturn (touch_ret); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 main \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u0439\u043c\u0435\u0440 RTC, \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c PTC, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c sleep \u0440\u0435\u0436\u0438\u043c (\u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438), \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 main<\/b><\/p>\n<div class=\"spoiler_text\">system_interrupt_enable_global();<br \/>  \/\/Initialize timer. (RTC actually<br \/>  timer_init();<br \/>  \/\/Initialize QTouch library and configure touch sensors.<br \/>  touch_sensors_init();<br \/>  NVMCTRL-&gt;CTRLB.bit.SLEEPPRM = 3;<br \/>  system_set_sleepmode(SYSTEM_SLEEPMODE_STANDBY);  <\/div>\n<\/div>\n<p>  \u041f\u0443\u0441\u0442\u044c \u0432 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u043d\u0430\u0441 \u0438\u043d\u0434\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430\u043c\u0438 \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u043a \u043a\u043d\u043e\u043f\u043a\u0435 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430. \u0420\u043e\u0442\u043e\u0440 \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c.<br \/>  \u0412 while(1) \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0437\u0430\u0441\u044b\u043f\u0430\u043d\u0438\u044f (\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438), \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u0436\u0438\u0433\u0430\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u044f:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0434\u043b\u044f while(1)<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/ Goto STANDBY sleep mode, unless woken by timer or PTC interrupt. \t\tsystem_sleep(); \/\/ Start touch sensor measurement, if touch_time.time_to_measure_touch flag is set by timer.    \t      touch_sensors_measure(); \t\tif ((p_mutlcap_measure_data-&gt;measurement_done_touch == 1u))  \t\t{ \t\t\tp_mutlcap_measure_data-&gt;measurement_done_touch = 0u;  \t\t\t\/\/ Get touch sensor states \t\t\tbutton1_state = GET_MUTLCAP_SENSOR_STATE(0); \t\t\tbutton2_state = GET_MUTLCAP_SENSOR_STATE(1); \t\t\trotor_state = GET_MUTLCAP_SENSOR_STATE(2); \t\t\tslider_state = GET_MUTLCAP_SENSOR_STATE(3);  \t\t\tif (button1_state)  \t\t\t{ \t\t\t\tif(button_pressed!=1) \t\t\t\t{ \t\t\t\t\tport_pin_set_output_level(LED_8_PIN, 0); \t\t\t\t\tbutton_pressed=1;\t\t\t\t\t \t\t\t\t} \t\t\t} \t\t\telse  \t\t\t{ \t\t\t\tport_pin_set_output_level(LED_8_PIN, 1); \t\t\t\tif (button_pressed==1) \t\t\t\t{ \t\t\t\t\tbutton_pressed=0; \t\t\t\t} \t\t\t}  \t\t\tif (button2_state) \t\t\t{ \t\t\t\tif(button_pressed!=2) \t\t\t\t{ \t\t\t\t\tport_pin_set_output_level(LED_9_PIN, 0); \t\t\t\t\tbutton_pressed=2; \t\t\t\t} \t\t\t}  \t\t\telse \t\t\t{ \t\t\t\tport_pin_set_output_level(LED_9_PIN, 1); \t\t\t\tif (button_pressed==2) \t\t\t\t{ \t\t\t\t   button_pressed=0; \t\t\t\t} \t\t\t}  \t\t\t\/\/ Clear all slider controlled LEDs \t\t\tport_pin_set_output_level(LED_0_PIN, 1); \t\t\tport_pin_set_output_level(LED_1_PIN, 1); \t\t\tport_pin_set_output_level(LED_2_PIN, 1); \t\t\tport_pin_set_output_level(LED_3_PIN, 1); \t\t\tport_pin_set_output_level(LED_4_PIN, 1); \t\t\tport_pin_set_output_level(LED_5_PIN, 1); \t\t\tport_pin_set_output_level(LED_6_PIN, 1); \t\t\tport_pin_set_output_level(LED_7_PIN, 1);  \t\t\t\/\/ If slider is activated \t\t\tif(slider_state) \t\t\t{ \t\t\t\t \/\/ Parse slider position \t\t\t\tslider_position = GET_MUTLCAP_ROTOR_SLIDER_POSITION(1); \t\t\t\t \t\t\t\tslider_position = slider_position &gt;&gt; 5u; \t\t\t\t \t\t\t \t\t\t\tswitch(slider_position) \t\t\t\t{ \t\t\t\t\tcase 0: \t\t\t\t\t\tport_pin_set_output_level(LED_0_PIN, 0); \t\t\t\t\t\tbreak; \t\t\t\t\tcase 1: \t\t\t\t\t\tport_pin_set_output_level(LED_0_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_1_PIN, 0); \t\t\t\t\t\tbreak; \t\t\t\t\tcase 2: \t\t\t\t\t\tport_pin_set_output_level(LED_0_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_1_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_2_PIN, 0); \t\t\t\t\t\tbreak; \t\t\t\t\tcase 3: \t\t\t\t\t\tport_pin_set_output_level(LED_0_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_1_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_2_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_3_PIN, 0); \t\t\t\t\t\tbreak; \t\t\t\t\tcase 4: \t\t\t\t\t\tport_pin_set_output_level(LED_0_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_1_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_2_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_3_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_4_PIN, 0); \t\t\t\t\t\tbreak; \t\t\t\t\tcase 5: \t\t\t\t\t\tport_pin_set_output_level(LED_0_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_1_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_2_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_3_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_4_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_5_PIN, 0); \t\t\t\t\t\tbreak; \t\t\t\t\tcase 6: \t\t\t\t\t\tport_pin_set_output_level(LED_0_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_1_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_2_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_3_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_4_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_5_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_6_PIN, 0); \t\t\t\t\t\tbreak; \t\t\t\t\tcase 7: \t\t\t\t\t\tport_pin_set_output_level(LED_0_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_1_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_2_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_3_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_4_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_5_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_6_PIN, 0); \t\t\t\t\t\tport_pin_set_output_level(LED_7_PIN, 0); \t\t\t\t\t\tbreak; \t\t\t\t\tdefault: \t\t\t\t\t\tport_pin_set_output_level(LED_0_PIN, 1); \t\t\t\t\t\tport_pin_set_output_level(LED_1_PIN, 1); \t\t\t\t\t\tport_pin_set_output_level(LED_2_PIN, 1); \t\t\t\t\t\tport_pin_set_output_level(LED_3_PIN, 1); \t\t\t\t\t\tport_pin_set_output_level(LED_4_PIN, 1); \t\t\t\t\t\tport_pin_set_output_level(LED_5_PIN, 1); \t\t\t\t\t\tport_pin_set_output_level(LED_6_PIN, 1); \t\t\t\t\t\tport_pin_set_output_level(LED_7_PIN, 1); \t\t\t\t\t\tbreak; \t\t\t\t} \t\t\t} \t\t}\/\/measurement done flag <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c, \u0437\u0430\u043b\u0438\u0432\u0430\u0435\u043c, \u043d\u0430\u0441\u043b\u0430\u0436\u0434\u0430\u0435\u043c\u0441\u044f.               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/geektimes.ru\/post\/266890\/\"> http:\/\/geektimes.ru\/post\/266890\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043d\u0430\u0448 \u0430\u043c\u0431\u0438\u0446\u0438\u043e\u0437\u043d\u044b\u0439 \u00abHello, World!\u00bb \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 Atmel SAMD21 Xplained, \u0437\u0430\u0442\u0435\u044f\u043d\u043d\u044b\u0439 \u0432 <a href=\"http:\/\/geektimes.ru\/company\/rainbow\/blog\/266368\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Wi-Fi \u043c\u043e\u0434\u0443\u043b\u0435\u043c WINC1500.<br \/>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Q-touch. <br \/>  <iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/n-qHjWmsnro?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><br \/>  \u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0446\u0438\u043a\u043b\u0430, \u043a\u0430\u043a \u0438 \u0431\u044b\u043b\u043e \u043e\u0431\u0435\u0449\u0430\u043d\u043e, \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u044d\u0442\u0438\u0445 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u00ab\u0437\u0430\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f\u00bb \u0432 \u043f\u043e\u0441\u044b\u043b\u043a\u0443 ModBus TCP \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e Wi-Fi \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043e\u0444\u0438\u0441\u0435.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-269729","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/269729","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=269729"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/269729\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=269729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=269729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=269729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}