<?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/item/38-uchebnyy-kurs-opros-knopok.html</link>
		<lastBuildDate>Wed, 29 Apr 2026 15:54:11 +0000</lastBuildDate>
		<generator>JComments</generator>
		<atom:link href="https://chipenable.ru/index.php/component/jcomments/feed/com_k2/38.html" rel="self" type="application/rss+xml" />
		<item>
			<title>SIG says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-4414</link>
			<description><![CDATA[Нужна ваша помощь. Пишу программу в которой разные функции будут включаться малым количеством кнопок. Работа на отжатие одной кнопки такая: if(PINB.4==0) { delay_ms(150); // антидребезг кнопки if(PINB.4==0) // повторная проверка { while(PINB.4==0 ); код программы; } } Нужен код нажатия двух кнопок одновременно. С этим не получается.]]></description>
			<dc:creator>SIG</dc:creator>
			<pubDate>Thu, 05 Feb 2015 15:40:35 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-4414</guid>
		</item>
		<item>
			<title>Максим says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3793</link>
			<description><![CDATA[Спасибо за помощь и за полезные библиотки. В форму напишу обязательно. Вышел из ситуации пока-что так: использовал кнопки вверх и вниз для ввода числа, а копку отменадля умножения на 10 (т.е. сдвига влево. Получаетсявведе нное число сдвигается на местодесятков, вводишь значение. Снова "отмена" теперьу тебя уже сотни и десятки, вводишь единицы)]]></description>
			<dc:creator>Максим</dc:creator>
			<pubDate>Sat, 08 Feb 2014 06:32:48 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3793</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3792</link>
			<description><![CDATA[Надо поискать. У меня где-то готовый вариант валяется. Напиши мне через форму обратной связи, чтобы я не забыл.]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Fri, 07 Feb 2014 17:44:25 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3792</guid>
		</item>
		<item>
			<title>Максим says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3789</link>
			<description><![CDATA[Спасибо. Работает. Неправильно использовал библиотеку. Не увидел что буфер обнуляется. Присвоил переменной значения буфера и все стало работать нормально. Попробовал добавить длительное нажатие в библиотеку... теперь не срабатывает короткое нажатие. Увеличивал THRESHOLD2 и THRESHOLD. Посоветуйте как правильно изменить библиотеку чтобы работало и короткое и длительное нажатие?]]></description>
			<dc:creator>Максим</dc:creator>
			<pubDate>Fri, 07 Feb 2014 14:50:51 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3789</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3763</link>
			<description><![CDATA[У тебя где-то в проекте ошибка. Этот код я неоднократно использовал. Например, здесь - http://chipenable.ru/index.php/programming-avr/item/75-chasy-na-mikrokontrollere-avr.html и здесь - http://chipenable.ru/index.php/programming-avr/item/50-organizatsiya-programm-sobytiynaya-sistema-prakticheskiy-primer.html. Там он немного изменен, чтобы события в буфере сохранять, но суть та же.]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Sun, 02 Feb 2014 17:47:35 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3763</guid>
		</item>
		<item>
			<title>Максим says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3762</link>
			<description><![CDATA[Не работает в CVAVR. Заменил ioavr.h на io.h Не реагирует на кнопки.]]></description>
			<dc:creator>Максим</dc:creator>
			<pubDate>Sun, 02 Feb 2014 12:03:39 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3762</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3698</link>
			<description><![CDATA[В первом макросе не хватает оператора отрицания !. Если его добавить, они будут выполняться одинаково.
#def ine BitIsClear(reg, bit) (!(reg & (1]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Tue, 28 Jan 2014 11:44:42 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3698</guid>
		</item>
		<item>
			<title>_Артём_ says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3693</link>
			<description><![CDATA[Потому что на протезах далеко не уйдёшь...]]></description>
			<dc:creator>_Артём_</dc:creator>
			<pubDate>Tue, 28 Jan 2014 06:52:17 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3693</guid>
		</item>
		<item>
			<title>klnd says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3692</link>
			<description><![CDATA[Здравствуйте! При использовании пошаговой отладки в AVR Studio 4.19 работает, #define BitIsClear(reg, bit) (reg & (1]]></description>
			<dc:creator>klnd</dc:creator>
			<pubDate>Tue, 28 Jan 2014 00:52:15 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-3692</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-2800</link>
			<description><![CDATA[Скинь свой проект целиком в эту ветку форума, я посмотрю. http://chipenable.ru/index.php/forum/materialy-sajta-chipenable/3245-vetka-dlya-vremennogo-khraneniya-proektov.html]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Wed, 10 Apr 2013 19:13:37 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-2800</guid>
		</item>
		<item>
			<title>SevitOFF says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-2797</link>
			<description><![CDATA[Всем привет! Pashgan помоги с написанием программы пожалуйста! Хочу сделать кодовый замок с UART в будущем, но пока застрял кажется на элементарном. #include 
#include 
#include "indicator.h"
# include "buttons.h"
uns igned char counterProg = 0;
unsigned char pass[4];
unsign ed char temp[4];
unsign ed char i;
unsigned char kol = 1;
void main(void)
{
pa ss[1]=3;
pass[2 ]=5;
pass[3]=2; 
temp[1]=0;
tem p[2]=0;
temp[3] =0;
#asm("sei") 
IND_Init();
BU T_Init(); TIMSK = (1]]></description>
			<dc:creator>SevitOFF</dc:creator>
			<pubDate>Wed, 10 Apr 2013 14:15:27 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-2797</guid>
		</item>
		<item>
			<title>Viktor2011 says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1895</link>
			<description><![CDATA[Pashgan помоги разобраться с кнопками,опиши или подскажи где можно найти тем кто учит AVR сам, только с интернета.Хорош о бы с полными примерами "В этой статье я опишу содержимое файлов драйвера, а в следующей разберу какой-нибудь практический пример. " Если можно, то примеры для AVR STUDIO Зарание СПАСИБО]]></description>
			<dc:creator>Viktor2011</dc:creator>
			<pubDate>Sun, 11 Dec 2011 16:25:52 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1895</guid>
		</item>
		<item>
			<title>Viktor2011 says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1861</link>
			<description><![CDATA[cпасибо за курс, хотелось бы побольше коментариев.Спа сибо и SergeyB вопрос что значат 1;3:4?откуда они взяты [ if (i== 2) PORTA = 134; else if (i== 1) ] может 2 это 0b00000010 а 1 это 0b00000001]]></description>
			<dc:creator>Viktor2011</dc:creator>
			<pubDate>Tue, 22 Nov 2011 20:32:55 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1861</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1842</link>
			<description><![CDATA[Достаточно заменить ioavr.h в строке #include  на заголовочный файл используемый в WINAVR]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Fri, 11 Nov 2011 09:28:48 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1842</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1841</link>
			<description><![CDATA[Достаточно заменить ioavr.h в строке #include  на заголовочный файл используемый в CVAVR.]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Fri, 11 Nov 2011 09:28:23 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1841</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1840</link>
			<description><![CDATA[Да. Идея в том, чтобы запускать эту функцию циклично.. Проще всего это реализовать с помощью прерываний таймеров.]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Fri, 11 Nov 2011 09:25:43 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1840</guid>
		</item>
		<item>
			<title>vlad145 says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1666</link>
			<description><![CDATA[А как её перевести в CVAVR?]]></description>
			<dc:creator>vlad145</dc:creator>
			<pubDate>Sun, 04 Sep 2011 16:41:14 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1666</guid>
		</item>
		<item>
			<title>wellcom says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1526</link>
			<description><![CDATA[Функция void BUT_Debrief(voi d) написано, что вызывается в прерывании таймера. А из других мест (прерываний) ее можно вызывать?]]></description>
			<dc:creator>wellcom</dc:creator>
			<pubDate>Thu, 09 Jun 2011 08:26:49 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1526</guid>
		</item>
		<item>
			<title>anwi says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1434</link>
			<description><![CDATA[Очень полезная библиотечка! А как бы ее к WinAVR адаптировать?]]></description>
			<dc:creator>anwi</dc:creator>
			<pubDate>Thu, 07 Apr 2011 05:29:16 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1434</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1268</link>
			<description><![CDATA[Читаем описание: А значит эту функцию нужно вызывать однократно!!]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Sun, 27 Feb 2011 09:37:29 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1268</guid>
		</item>
		<item>
			<title>SergeyB says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1259</link>
			<description><![CDATA[BUT_Init(); DDRA=255; PORTA = 128; while(1){ BUT_Debrief(); i=BUT_GetKey(); if (i== 2) PORTA = 134; else if (i== 1) PORTA = 113; else if (i== 3) PORTA = 213; else if (i== 4) PORTA = 132; } return 0; искупил свои грехи, этот код работает!]]></description>
			<dc:creator>SergeyB</dc:creator>
			<pubDate>Sat, 26 Feb 2011 08:32:52 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1259</guid>
		</item>
		<item>
			<title>SergeyB says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1245</link>
			<description><![CDATA[Спасибо большое за ответ, я все исправил, но когда я пытаюсь зажечь разные светодиоды , по нажатию кнопок, у меня работает лишь та кнопка , которая после if (все кнопки на это место пробовал ставить - все работали, а остальные 3 нет) , которая после else if не работает.
int main(void)
{
BU T_Init(); DDRA=255; PORTA = 128; while(1){ BUT_Debrief(); if (BUT_GetKey()== 2) PORTA = 134; else if (BUT_GetKey()== 1) PORTA = 113; else if (BUT_GetKey()== 3) PORTA = 213; else if (BUT_GetKey()== 4) PORTA = 132; } return 0;
}]]></description>
			<dc:creator>SergeyB</dc:creator>
			<pubDate>Fri, 25 Feb 2011 08:36:44 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1245</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1239</link>
			<description><![CDATA[void убери перед BUT_Init() Компилятор воспринимает это как объявление прототипа функции, а не ее вызов.]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Thu, 24 Feb 2011 22:46:28 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1239</guid>
		</item>
		<item>
			<title>SergeyB says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1230</link>
			<description><![CDATA[Не работает программа по нажатию кнопки зажигающая светодиоды. Использовал Atmega16, buttons.h я поправил. Светодииоды висят на порту А. После инициализации я приравниваю портА=128 чтобы проверить, работу порта, один диод горит как надо. Но по нажатию кнопки ничего не происходит. В чем моя ошибка?
#includ e "buttons.h"
#de fine MASK_BUTTONS (1]]></description>
			<dc:creator>SergeyB</dc:creator>
			<pubDate>Thu, 24 Feb 2011 16:24:11 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-1230</guid>
		</item>
		<item>
			<title>Guest says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-104</link>
			<description><![CDATA[Ставь обычные резюки кОм в 10, наводки исчезнут. Долго не мог побороть - внутренние часто не тянут ни фига]]></description>
			<dc:creator>Guest</dc:creator>
			<pubDate>Mon, 04 Jan 2010 19:19:04 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-104</guid>
		</item>
		<item>
			<title>alexandershahbazov says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-69</link>
			<description><![CDATA[Забыл поздравить ЦСКА с выходом в 1/8 !!!]]></description>
			<dc:creator>alexandershahbazov</dc:creator>
			<pubDate>Tue, 08 Dec 2009 23:54:49 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-69</guid>
		</item>
		<item>
			<title>alexandershahbazov says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-68</link>
			<description><![CDATA[конденсаторы по входам не ставил , а использовал internal pull-up (P) resistor ( из CodeVisionAVR ) .]]></description>
			<dc:creator>alexandershahbazov</dc:creator>
			<pubDate>Tue, 08 Dec 2009 23:38:03 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-68</guid>
		</item>
		<item>
			<title>Pashgan says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-66</link>
			<description><![CDATA[наводки наверное... конденсаторы по входам пробовали ставить?]]></description>
			<dc:creator>Pashgan</dc:creator>
			<pubDate>Tue, 08 Dec 2009 23:15:50 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-66</guid>
		</item>
		<item>
			<title>alexandershahbazov says:</title>
			<link>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-54</link>
			<description><![CDATA[У меня иногда случалось самопроизвольно е включение кнопки без нажатия . Когда положил плату ( на проводах ) в корпус все прекратилось . Какими могут быть основные причины .]]></description>
			<dc:creator>alexandershahbazov</dc:creator>
			<pubDate>Tue, 08 Dec 2009 20:47:44 +0000</pubDate>
			<guid>https://chipenable.ru/index.php/programming-avr/item/38-uchebnyy-kurs-opros-knopok.html#comment-54</guid>
		</item>
	</channel>
</rss>
