<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Библиотека для опроса кнопок</title>
		<description>Discuss Библиотека для опроса кнопок</description>
		<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html</link>
		<lastBuildDate>Wed, 08 Apr 2026 15:29:30 +0000</lastBuildDate>
		<generator>JComments</generator>
		<atom:link href="https://chipenable.ru/index.php/component/jcomments/feed/com_k2/218.html" rel="self" type="application/rss+xml" />
		<item>
			<title>Андрей says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-5151</link>
			<description><![CDATA[Можно ли использовать эту бибилиотеку с Arduino IDE ?]]></description>
			<dc:creator>Андрей</dc:creator>
			<pubDate>Thu, 24 Aug 2017 11:43:50 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-5151</guid>
		</item>
		<item>
			<title>SAnyo says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4920</link>
			<description><![CDATA[Здравствуйте. CVAVR ругается на строку but = BUT_GetBut(); Error: a value of type 'const void' can't be assigned to an entity of type 'uint8_t' В чем может быть причина? Спасибо.]]></description>
			<dc:creator>SAnyo</dc:creator>
			<pubDate>Mon, 03 Oct 2016 06:10:43 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4920</guid>
		</item>
		<item>
			<title>KentAVR says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4854</link>
			<description><![CDATA[В Atmega128 не работала кнопка на PF6, потому что JTAG был включён. Вырубил фьюзом, полёт нормальный. Спасибо за либу!]]></description>
			<dc:creator>KentAVR</dc:creator>
			<pubDate>Tue, 21 Jun 2016 04:42:27 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4854</guid>
		</item>
		<item>
			<title>KentAVR says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4853</link>
			<description><![CDATA[В м128 PORTF находится в расширенной области РВВ Так, получается кнопку приделать к PF0, но не PF4, PF6...]]></description>
			<dc:creator>KentAVR</dc:creator>
			<pubDate>Tue, 21 Jun 2016 04:30:20 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4853</guid>
		</item>
		<item>
			<title>Ternity says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4851</link>
			<description><![CDATA[Вот так работать не будет. Запустится, но ничегошеньки... #define BUT_PRESSED_COD E 0 #define BUT_HELD_CODE 2 #define BUT_RELEASED_CO DE 3 #define BUT_RELEASED_LO NG_CODE 4 #define BUT_DOUBLE_CLIC K_CODE 1]]></description>
			<dc:creator>Ternity</dc:creator>
			<pubDate>Tue, 21 Jun 2016 03:58:57 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4851</guid>
		</item>
		<item>
			<title>Mic29 says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4752</link>
			<description><![CDATA[Собственно решал похожую задачку. Куча датчиков и кнопок (от 24 до 32) подключены через сдвиговые регистры 74HC597. Объявлены четыре массива по 32 эл-та, в одном задается какой сигнал (инверсный или прямой), во втором - кол-во считываний входа для решения о достоверности сигнала, в третьем - результат, четвертый - статический в процедуре опроса. Считывается все подряд, при необходимости инвертируется. И дальше - если есть сигнал то в стат. массиве +=1 (но не больше числа заданного в массиве 2), нет сигнала -=1 (но не меньше 0). Сразу же смотрим, если набрали требуемое кол-во считываний, записываем в третий массив. Соответственно, за число проходов определенное во втором массиве для каждого конкретного входа (независимо) или досчитает или - нет. А в третьем массиве - результат. Остается только интерпретироват ь. Можно в глоб. цикле опрашивать, можно по прерываниям.]]></description>
			<dc:creator>Mic29</dc:creator>
			<pubDate>Mon, 14 Mar 2016 09:46:54 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4752</guid>
		</item>
		<item>
			<title>Mik says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4734</link>
			<description><![CDATA[Здравствуйте. Пользуюсь Atmel Studio 7.0 Судя по тому, что получается, код библиотеки не выполняется вообще. Такой вывод делаю из того, что даже подтяжка на ножке не включается. Думаю, что накосячил в пункте 2. Подключаем buttons.c к проекту. В Solution Explorer я кликаю правой кнопкой по названию проекта, далее Add -> Existing Item - >Buttons.c, который лежит в папке, в которой лежит main.c, то есть исходный файл проекта. Я не правильно понял, как подключать файл?]]></description>
			<dc:creator>Mik</dc:creator>
			<pubDate>Sat, 06 Feb 2016 23:47:48 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4734</guid>
		</item>
		<item>
			<title>ay8910 says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4733</link>
			<description><![CDATA[Отличная библиотека, грамотный, правильный код С. Без особых усилий портировалась под SDCC и используется мною на STM8. Спасибо!]]></description>
			<dc:creator>ay8910</dc:creator>
			<pubDate>Thu, 04 Feb 2016 05:05:36 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4733</guid>
		</item>
		<item>
			<title>Rosin55 says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4728</link>
			<description><![CDATA[Надо добавить файл библиотеки в проект - ПКМ/ add extern items.]]></description>
			<dc:creator>Rosin55</dc:creator>
			<pubDate>Sat, 30 Jan 2016 07:54:40 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4728</guid>
		</item>
		<item>
			<title>DVF says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4572</link>
			<description><![CDATA[А если надо выполнить действие по двум одновременно нажатым кнопкам? Или надо, чтобы при нажатой кнопке нажатие другой не оказывало влияния? Библиотека позволяет это реализовать?]]></description>
			<dc:creator>DVF</dc:creator>
			<pubDate>Fri, 21 Aug 2015 11:20:30 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4572</guid>
		</item>
		<item>
			<title>demiurg says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4551</link>
			<description><![CDATA[ 1 - Ничего заумного нет. 2 - КА решают самую главную проблему - псевдопараллель ность процессов.]]></description>
			<dc:creator>demiurg</dc:creator>
			<pubDate>Wed, 29 Jul 2015 06:26:10 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4551</guid>
		</item>
		<item>
			<title>VladCh says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4550</link>
			<description><![CDATA[У Татарчевского все как-то заумно написано, чтобы понять надо вчитываться. Здесь же - все просто и понятно. Может у него и правильней, но для тех, кто занимается программировани ем в бытовых целях (это я про себя :) ) изучать всю теорию КА смысла нет. Здесь же все просто, понятно и доходчиво объяснено с реальными примерами, за что автору низкий поклон. В общем, как говорится, каждый выбирает для себя...]]></description>
			<dc:creator>VladCh</dc:creator>
			<pubDate>Wed, 29 Jul 2015 04:18:44 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4550</guid>
		</item>
		<item>
			<title>demiurg says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4546</link>
			<description><![CDATA[Вообще, если честно, мне эта библиотека не очень. Есть отличный цикл статей Татарчевского. И там в подробностях расписано как реализовать опрос кнопок. http://www.kit-e.ru/articles/circuit/2006_11_164.php]]></description>
			<dc:creator>demiurg</dc:creator>
			<pubDate>Thu, 16 Jul 2015 16:14:56 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4546</guid>
		</item>
		<item>
			<title>demiurg says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4545</link>
			<description><![CDATA[У кодевижн свои файлы I\O. Ищите какой файл кодевижен соответствует определениям I\O AVR.]]></description>
			<dc:creator>demiurg</dc:creator>
			<pubDate>Thu, 16 Jul 2015 16:11:58 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4545</guid>
		</item>
		<item>
			<title>Артём Б says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4544</link>
			<description><![CDATA[День добрый!!! Сделал всё как написано в статье, а кодевижен мне выдаёт : Error: C:\cvavreval\in c\buttons.h(17) , included from: òàéìåð 2.c: can't open #include file: ioavr.h что подскажете?]]></description>
			<dc:creator>Артём Б</dc:creator>
			<pubDate>Thu, 16 Jul 2015 15:16:12 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4544</guid>
		</item>
		<item>
			<title>MrOops says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4505</link>
			<description><![CDATA[#define _TestBit(var, bit, lev) _TestBit##lev(v ar, bit)
#define TestBitLev(var, bit, lev) _TestBit(var, bit, lev) _TestBit##lev(v ar, bit) как это работает]]></description>
			<dc:creator>MrOops</dc:creator>
			<pubDate>Sun, 26 Apr 2015 13:45:33 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4505</guid>
		</item>
		<item>
			<title>MrOops says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4504</link>
			<description><![CDATA[/*макрос проверки состояния пина. зависит от активного уровня в настройках*/ #define _TestBit1(var, bit) ((var) & (1]]></description>
			<dc:creator>MrOops</dc:creator>
			<pubDate>Sun, 26 Apr 2015 13:43:32 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4504</guid>
		</item>
		<item>
			<title>Дима says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4494</link>
			<description><![CDATA[Разобрался.. У меня нет просто порта C]]></description>
			<dc:creator>Дима</dc:creator>
			<pubDate>Sun, 12 Apr 2015 15:22:38 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4494</guid>
		</item>
		<item>
			<title>Дима says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4493</link>
			<description><![CDATA[Error	1	'DDRC' undeclared (first use in this function)	C:\Us ers\Dmitry\Desk top\avrstud\FF\ FF\buttons.c	25 5	3	FF Error	3	'PORTC' undeclared (first use in this function)	C:\Us ers\Dmitry\Desk top\avrstud\FF\ FF\buttons.c	25 5	3	FF Error	4	'PINC' undeclared (first use in this function)	C:\Us ers\Dmitry\Desk top\avrstud\FF\ FF\buttons.c	39 6	1	FF]]></description>
			<dc:creator>Дима</dc:creator>
			<pubDate>Sun, 12 Apr 2015 15:18:00 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4493</guid>
		</item>
		<item>
			<title>tipok says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4327</link>
			<description><![CDATA[Добрый день.. а можно посмотреть код с реализацией удержания кнопки? чота не как не пойму ка это работает.]]></description>
			<dc:creator>tipok</dc:creator>
			<pubDate>Mon, 27 Oct 2014 03:42:09 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4327</guid>
		</item>
		<item>
			<title>stas says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4303</link>
			<description><![CDATA[Добрый день, как подключить си файл и библиотеку atmel studio 6? Инклуд прописал, сишный файл в проект добавил, адрес компилятору указал.]]></description>
			<dc:creator>stas</dc:creator>
			<pubDate>Sun, 28 Sep 2014 15:34:21 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4303</guid>
		</item>
		<item>
			<title>rusin.aleks says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4284</link>
			<description><![CDATA[Что такое #define End_m()?]]></description>
			<dc:creator>rusin.aleks</dc:creator>
			<pubDate>Tue, 09 Sep 2014 14:50:51 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4284</guid>
		</item>
		<item>
			<title>Ersafap says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4253</link>
			<description><![CDATA[Здравствуйте. Попробовал применить либу в таймере. Сбоит. Например если я жму несколько раз одну кнопку а после жму другую, то действие выполняется для первой кнопки(один раз), хотя код второй я даже не обрабатываю. Последующие нажатия на вторую кнопку эффекта не дают. Если после этого снова нажать первую кнопку то можно будет снова нажать 1 раз вторую и она обработается как первая.]]></description>
			<dc:creator>Ersafap</dc:creator>
			<pubDate>Sun, 20 Jul 2014 23:07:23 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4253</guid>
		</item>
		<item>
			<title>ibiza11 says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4084</link>
			<description><![CDATA[Автор уже поправил пост. Можно заменить на "кратно" на "равно"]]></description>
			<dc:creator>ibiza11</dc:creator>
			<pubDate>Fri, 16 May 2014 06:22:26 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4084</guid>
		</item>
		<item>
			<title>WithLove says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4076</link>
			<description><![CDATA["5. Задаем размер буфера событий. Его значение должно быть кратно 2. " Например, 6? )) И что тогда будет при head &= (BUT_SIZE_BUF - 1);]]></description>
			<dc:creator>WithLove</dc:creator>
			<pubDate>Thu, 08 May 2014 08:07:33 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4076</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4061</link>
			<description><![CDATA[Напиши на форум и приложи проект. Вот ветка http://chipenable.ru/index.php/forum/materialy-sajta-chipenable/3347-biblioteka-dlya-oprosa-knopok.html]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Fri, 02 May 2014 21:34:46 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4061</guid>
		</item>
		<item>
			<title>virustek says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4060</link>
			<description><![CDATA[все так же:" Error 1 undefined reference to `BUT_Init()'" Для всех вызываемых функций.]]></description>
			<dc:creator>virustek</dc:creator>
			<pubDate>Fri, 02 May 2014 21:21:54 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4060</guid>
		</item>
		<item>
			<title>virustek says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4059</link>
			<description><![CDATA[да блин #include ]]></description>
			<dc:creator>virustek</dc:creator>
			<pubDate>Fri, 02 May 2014 20:51:04 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4059</guid>
		</item>
		<item>
			<title>virustek says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4058</link>
			<description><![CDATA[*дополнение: не подключает #include]]></description>
			<dc:creator>virustek</dc:creator>
			<pubDate>Fri, 02 May 2014 20:47:05 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4058</guid>
		</item>
		<item>
			<title>virustek says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4057</link>
			<description><![CDATA[Это моя опечатка, пытался переобозвать файл и скинул не ту версию кода, поправил как надо, не подключает в хедере buttons.h библиотеку #include , компилятор просто отказывается показать путь в нее, хотя из той же папки interrupt.h видит прекрасно, пока не смог подключить.]]></description>
			<dc:creator>virustek</dc:creator>
			<pubDate>Fri, 02 May 2014 20:45:17 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4057</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4055</link>
			<description><![CDATA[Да и у меня тоже простая концепция. Один алгоритм на все кнопки. Проверяется нажата она или нет и ее состояние передается в функцию, а та уже все анализирует. Я просто не знаю, как можно подсчитывать время нажатия нескольких кнопок, используя только один счетчик. Знаю один алгоритм, но он не позволяет обрабатывать одновременные нажатия.]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Fri, 02 May 2014 19:12:29 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4055</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4054</link>
			<description><![CDATA[Это зависит от задачи. Для 18-и кнопок я отвел 36 байт в ОЗУ и что. У меня 4 кБ.]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Fri, 02 May 2014 18:57:11 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4054</guid>
		</item>
		<item>
			<title>demiurg says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4052</link>
			<description><![CDATA[поправка 100 регистров]]></description>
			<dc:creator>demiurg</dc:creator>
			<pubDate>Fri, 02 May 2014 18:50:24 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4052</guid>
		</item>
		<item>
			<title>demiurg says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4051</link>
			<description><![CDATA[В приведенном мной примере очень простая концепция. Все кнопки, сколько бы их не было, обрабатываются как одна. Вы что, для ста кнопок будете 10 регистров отводить?]]></description>
			<dc:creator>demiurg</dc:creator>
			<pubDate>Fri, 02 May 2014 18:49:07 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4051</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4050</link>
			<description><![CDATA[Здесь неправильно #include ]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Fri, 02 May 2014 18:48:45 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4050</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4049</link>
			<description><![CDATA[У каждой кнопки есть свой регистр состояния и свой счетчик. При нажатии на кнопку счетчик начинает считать. Как только он досчитал до первого порога, фиксируется событие "нажатие" и устанавливается флаг. Как только он досчитал до второго порога, фиксируется событие "длительное удержание" и устанавливается флаг. Когда кнопка отпускается проверяется флаги регистра состояния. В одном случае фиксируется событие "отпускание после короткого удержания", в другом случае - "отпускание после длительного удержания". Если используется двойной клик, то добавляется второй счетчик, который считает время прошедшее между двумя нажатиями. Если это время меньше порогового, то фиксируется событие "двойной клик". Вот и весь алгоритм.]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Fri, 02 May 2014 18:45:08 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4049</guid>
		</item>
		<item>
			<title>demiurg says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4046</link>
			<description><![CDATA[button/buttons. h.h]]></description>
			<dc:creator>demiurg</dc:creator>
			<pubDate>Fri, 02 May 2014 17:26:45 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4046</guid>
		</item>
		<item>
			<title>virustek says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4044</link>
			<description><![CDATA[Пытаюсь использовать библиотеку в Atmel Studio 6.2 выдает ошибку, что undefined reference to `BUT_Init', итак со всеми вызываемыми функциями. //#include 
#define F_CPU 8000000UL
#incl ude 
#include 
//#include 
#include 
uint8_t but = 0;
uint8_t code = 0;
int main( void )
{	BUT_Init(); 	DDRB=0x0e; //Инициализация портов, OC1A,OC1B,OC2 - выходы	sei();// __enable_interr upt();	while(1) {	_delay_ms(2); 	/*опрос кнопок*/	BUT_Po ll();	/*проверк а буфера*/	but = BUT_GetBut();	/ *если зафиксировано событие*/	if (but){	/*берем код события*/	code = BUT_GetBut();	i f (code == 1)	{	PORTB = (1]]></description>
			<dc:creator>virustek</dc:creator>
			<pubDate>Fri, 02 May 2014 17:24:21 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4044</guid>
		</item>
		<item>
			<title>demiurg says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4043</link>
			<description><![CDATA[Много букафф. Непонятный алгоритм. Понятно, что хочется удобств. Привязка к таблице резонна, если один автомат. У меня за долгое время прижился следующий алгоритм. Кстати, кое-что взято с цикла статей Татарчевского об автоматах. Сканирование. Здесь, в зависимости от реализации, считывание порта, сканирование матрицы, буфера дискретных входов. Если у нас в проекте только нажатие, то все гораздо проще. Переменные _kbd_drv, kbd_drv_flags, keys_curr, keys_prev. В функции сканирования сброс флага KEYS_PRESSED_FL G, сканирование, если есть нажатие,установ ка флага... М-м-м, проще кодом. Ссылка: http://pastebin.com/Vgz2ZyLT]]></description>
			<dc:creator>demiurg</dc:creator>
			<pubDate>Fri, 02 May 2014 15:42:34 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4043</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4021</link>
			<description><![CDATA[Исправил.]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Thu, 01 May 2014 08:15:04 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4021</guid>
		</item>
		<item>
			<title>Peter says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4020</link>
			<description><![CDATA[Посмотрел BUT_Init и сразу непонятно. Как так можно в цикле по "КоличествуКноп ок" BUT_AMOUNT+1 обнулять совершенно независимый "БуферСобытий" buf[]? А если количество кнопок будет > буфера соьытий ? Что мы тогда наобнуляем?]]></description>
			<dc:creator>Peter</dc:creator>
			<pubDate>Thu, 01 May 2014 07:50:41 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4020</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4019</link>
			<description><![CDATA[Не знаю какой алгоритм оптимальный. Никогда не заморачивался с этой темой. Я уже давно использую один и тот же алгоритм - http://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html.]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Wed, 30 Apr 2014 20:58:34 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4019</guid>
		</item>
		<item>
			<title>Andy says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4015</link>
			<description><![CDATA[Отлично, как всегда. У мея есть вопрос. Какой самый оптимальный алгоритм опроса кнопок в диспетчере задач? То есть запускаем задачу опроса кнопок раз, допустим в 100 миллисекунд, а дальше что? Если нажата, перезапускаем снова себя же через, ну, скажем, 50 миллисекунд (защита от дребезга) и если кнопка уже нажата или отжата делаем выводы, ставить флаг нажатой кнопки или еще нет, когда и где сбрасывать этот флаг? Прерывания использовать нельзя. Подскажите толковый алгоритм, пожалуйста. Если важно, какой диспетчер - то http://andromega.narod.ru/publics.html "Компактный диспетчер для встроенных систем"]]></description>
			<dc:creator>Andy</dc:creator>
			<pubDate>Wed, 30 Apr 2014 04:46:24 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4015</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4013</link>
			<description><![CDATA[Пожалуйста.]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Tue, 29 Apr 2014 21:01:43 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4013</guid>
		</item>
		<item>
			<title>foxit says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4012</link>
			<description><![CDATA[Спасибо.]]></description>
			<dc:creator>foxit</dc:creator>
			<pubDate>Tue, 29 Apr 2014 14:19:32 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4012</guid>
		</item>
		<item>
			<title>Alyes says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4010</link>
			<description><![CDATA[Спасибо!!! то, что нужно!!!]]></description>
			<dc:creator>Alyes</dc:creator>
			<pubDate>Tue, 29 Apr 2014 08:19:02 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/218-biblioteka-dlya-oprosa-knopok.html#comment-4010</guid>
		</item>
	</channel>
</rss>
