Warning: Table './drupal/sessions' is marked as crashed and last (automatic?) repair failed query: DELETE FROM sessions WHERE timestamp < 1773271956 in /var/www/fendercustomsh/data/www/avrlab.com/includes/database.mysqli.inc on line 128

Warning: Cannot modify header information - headers already sent by (output started at /var/www/fendercustomsh/data/www/avrlab.com/includes/database.mysqli.inc:128) in /var/www/fendercustomsh/data/www/avrlab.com/includes/bootstrap.inc on line 636

Warning: Cannot modify header information - headers already sent by (output started at /var/www/fendercustomsh/data/www/avrlab.com/includes/database.mysqli.inc:128) in /var/www/fendercustomsh/data/www/avrlab.com/includes/bootstrap.inc on line 637

Warning: Cannot modify header information - headers already sent by (output started at /var/www/fendercustomsh/data/www/avrlab.com/includes/database.mysqli.inc:128) in /var/www/fendercustomsh/data/www/avrlab.com/includes/bootstrap.inc on line 638

Warning: Cannot modify header information - headers already sent by (output started at /var/www/fendercustomsh/data/www/avrlab.com/includes/database.mysqli.inc:128) in /var/www/fendercustomsh/data/www/avrlab.com/includes/bootstrap.inc on line 639
РУССКИЙ ВОЕННЫЙ КОРАБЛЬ, ИДИ НАХУЙ! - динамическая индикация http://avrlab.com/taxonomy/term/138/0 ru Семисегментный индикатор и динамическая индикация на AVR микроконтроллере ATmega8 http://avrlab.com/node/130 <p>В разных конструкциях бывает оправдано использовать семисегментные светодиодные индикаторы, дешево и сердито по сравнению с <a href="http://avrlab.com/node/132">символьными ЖКИ</a>. Светодиодный индикатор представляет собой восемь светодиодов (7 для представления цифры и 1 для точки) расположенные в виде слегка наклоненной цифры:<br /> В разных конструкциях бывает оправдано использовать семисегментные светодиодные индикаторы, дешево и сердито по сравнению с <a href="https://avrlab.com/node/132">символьными ЖКИ</a>. Светодиодный индикатор представляет собой восемь светодиодов (7 для представления цифры и 1 для точки) расположенные в виде слегка наклоненной цифры:<br /> <img src="https://avrlab.com/upload_files/7_led_indicator.gif" alt="семисегментный светодиодный индикатор" width="144" height="127" /><br /> Светодиоды внутри имеют общий анод (ОА) или общий катод (ОК). То есть, для управления одной цифрой нужно 8 выводов микроконтроллера. А что же делать, когда нужно управлять, например, четырьмя цифрами? Использовать микроконтроллер с <strong>4*8=32</strong> выводами? Не экономично. </p> <p>Для такого случая придумали динамическую индикацию. Для этого соединяем выводы, которые отвечают за включение сегментов в общую шину, а общими анодами (катодами) будем управлять через транзисторы. В отдельный момент времени горит только одна цифра. Таким образом быстро перебирая цифры на дисплее (как кадры в фильме) мы получим эффект постоянно горящего изображения. В замедленном варианте, как это происходит, можно посмотреть на картинке:<br /> <img src="https://avrlab.com/upload_files/dyn_indication_anime.gif" alt="анимация динамической индикации" width="588" height="258" /><br /> А вот ускоренная в 25 раз картинка, уже начинают вырисовываться контуры «12.34»:<br /> <img src="https://avrlab.com/upload_files/dyn_indication_anime_speed.gif" alt="анимация динамической индикации" width="588" height="258" /><br /> Используя принцип динамической индикации мы сможем управлять четырьмя цифрами при помощи <strong>8+4=12</strong> выводов. <a href="https://avrlab.com/node/114">Использование же 2-х сдвиговых регистров HC595</a> может сократить это число до <strong>4</strong>. Рассмотрим схему подключения к микроконтроллеру:<br /> <a target="_blank" href="https://avrlab.com/upload_files/sch_hihg.gif"><img src="https://avrlab.com/upload_files/sch_low_0.gif" /></a><br /> Управлять же индикатором будем с помощью микроконтроллера <a href="https://avrlab.com/node/23">ATmega8</a>. Резисторы <strong>R5-R13</strong> – ограничительные на 470 Ом. <strong>R1-R4</strong> – по 1кОм. Транзисторы <strong>Q1-Q4</strong> – любые PNP типа, я использовал BC807 в планарном исполнении. Конденсаторы <strong>С5,С7</strong> – электролиты по 100 и 200мкф соответственно, <strong>С4,С6</strong> – керамика по 0,1мкф. Так как индикатор с общим анодом, то соответственно включение разряда/сегмента производиться низким уровнем. </p> <p>Для индикаторов с общим катодом схема аналогична, только транзисторы следует взять NPN структуры, и управляться индикатор будет высоким уровнем.<br /> Продемонстрируем сказанное, напишем программу, которая будет перебирать числа от 0 до 9999 и выводить их на семисегментный индикатор.<br /> <div class="geshifilter"><pre class="c geshifilter-c" style="font-family:monospace;"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #339933;">#include &lt;avr/io.h&gt;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #339933;">#include &lt;avr/interrupt.h&gt;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #666666; font-style: italic;">// 0 1 2 3 4 5 6 7 8 9 </span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #993333;">const</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> codes<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">10</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span><span style="color: #208080;">0x3f</span><span style="color: #339933;">,</span><span style="color: #208080;">0x06</span><span style="color: #339933;">,</span><span style="color: #208080;">0x5b</span><span style="color: #339933;">,</span><span style="color: #208080;">0x4f</span><span style="color: #339933;">,</span><span style="color: #208080;">0x66</span><span style="color: #339933;">,</span><span style="color: #208080;">0x6d</span><span style="color: #339933;">,</span><span style="color: #208080;">0x7d</span><span style="color: #339933;">,</span><span style="color: #208080;">0x07</span><span style="color: #339933;">,</span><span style="color: #208080;">0x7f</span><span style="color: #339933;">,</span><span style="color: #208080;">0x6f</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> data<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span><span style="color: #208080;">0x00</span><span style="color: #339933;">,</span><span style="color: #208080;">0x00</span><span style="color: #339933;">,</span><span style="color: #208080;">0x00</span><span style="color: #339933;">,</span><span style="color: #208080;">0x00</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> counter<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #993333;">void</span> pause <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> a<span style="color: #009900;">&#41;</span> </div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#123;</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> i<span style="color: #339933;">;</span> <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span>a<span style="color: #339933;">;</span>i<span style="color: #339933;">&gt;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #993333;">void</span> init_timer <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#123;</span> TIMSK<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span>TOIE0<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Enable timer overflow interrupt</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> TCCR0<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">&lt;&lt;</span>CS00<span style="color: #009900;">&#41;</span><span style="color: #339933;">|</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span>CS01<span style="color: #009900;">&#41;</span><span style="color: #339933;">|</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">&lt;&lt;</span>CS02<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Prescaller = /1</span></div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#125;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #993333;">void</span> convert_data <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> x<span style="color: #009900;">&#41;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#123;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> temp<span style="color: #339933;">,</span>res<span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> temp<span style="color: #339933;">=</span>x<span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> res<span style="color: #339933;">=</span>temp<span style="color: #339933;">/</span><span style="color: #0000dd;">1000</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Calculate 1000-s</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> data<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>codes<span style="color: #009900;">&#91;</span>res<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> temp<span style="color: #339933;">=</span>temp<span style="color: #339933;">-</span>res<span style="color: #339933;">*</span><span style="color: #0000dd;">1000</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> res<span style="color: #339933;">=</span>temp<span style="color: #339933;">/</span><span style="color: #0000dd;">100</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Calculate 100-s</span></div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> data<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>codes<span style="color: #009900;">&#91;</span>res<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> temp<span style="color: #339933;">=</span>temp<span style="color: #339933;">-</span>res<span style="color: #339933;">*</span><span style="color: #0000dd;">100</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> res<span style="color: #339933;">=</span>temp<span style="color: #339933;">/</span><span style="color: #0000dd;">10</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Calculaate 10-s</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> data<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>codes<span style="color: #009900;">&#91;</span>res<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> temp<span style="color: #339933;">=</span>temp<span style="color: #339933;">-</span>res<span style="color: #339933;">*</span><span style="color: #0000dd;">10</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> data<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>codes<span style="color: #009900;">&#91;</span>temp<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Calculate 1-s</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#125;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal">ISR <span style="color: #009900;">&#40;</span>TIMER0_OVF_vect<span style="color: #009900;">&#41;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#123;</span>PORTD<span style="color: #339933;">=</span><span style="color: #208080;">0xff</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> PORTB<span style="color: #339933;">=</span>~_BV<span style="color: #009900;">&#40;</span>counter<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Enable digit</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> PORTD<span style="color: #339933;">=</span>~data<span style="color: #009900;">&#91;</span>counter<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Write code</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> counter<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>counter<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">%</span><span style="color:#800080;">4</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Increment digit counter</span></div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">TCNT0<span style="color: #339933;">=</span><span style="color: #208080;">0x00</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Clear timer</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#125;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span></div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#123;</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> x<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">DDRD<span style="color: #339933;">=</span><span style="color: #208080;">0xff</span><span style="color: #339933;">;</span> </div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">PORTD<span style="color: #339933;">=</span><span style="color: #208080;">0x00</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">DDRB<span style="color: #339933;">=</span><span style="color: #208080;">0x0f</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">PORTB<span style="color: #339933;">=</span><span style="color: #208080;">0x0f</span><span style="color: #339933;">;</span> </div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">pause<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Settle pause</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">init_timer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Init timer</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">sei<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Interrupt enable</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span></div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#123;</span>convert_data<span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Conver data to codes</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>x<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">9999</span><span style="color: #009900;">&#41;</span> x<span style="color: #339933;">=</span>x<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Increment data</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> <span style="color: #b1b100;">else</span> x<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> pause<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">30000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#125;</span></div></li><li style="font-family: monospace; font-weight: bold; font-style: italic;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #b1b100;">return</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#125;</span></div></li></ol></pre></div><br /> Код очень простой. В массиве <strong>codes</strong> находятся коды, которые следует выводить на порт, чтобы получить желаемую цифру. Смена активной цифры производиться по прерыванию от переполнения таймера 0. А функция <strong>convert_data(int x)</strong> раскладывает число <strong>х</strong> по разрядам, и записывает соответствующие коды в массив <strong>data</strong>, данные из которого выводятся непосредственно на индикатор, при срабатывание прерывания.<br /> Что из этого вышло, можно глянуть на рисунках:<br /> <img src="https://avrlab.com/upload_files/240920101912.jpg" alt="фото динамической индикации" width="400" height="300" /><br /> <img src="https://avrlab.com/upload_files/240920101914.jpg" alt="фото динамической индикации" width="400" height="300" /></p> <p>Исходный код можно <a href="https://avrlab.com/mmm/a/togo.php?url=https://avrlab.info/upload_files/dyn_indication_PCB.zip">скачать в виде проекта под AVR Studio 4</a><br /> Также, может кому пригодиться, <a href="https://avrlab.com/mmm/a/togo.php?url=https://avrlab.info/upload_files/dyn_indication_PCB.zip">платка для моего табло в формате .lay для программы Sprint Layout 5</a></p> <p><a href="http://avrlab.com/node/130" target="_blank">Читать далее</a></p> http://avrlab.com/node/130#comments atmega8 avr динамическая индикация семисегментный светодиодный индикатор Fri, 24 Sep 2010 16:11:40 +0000 vakula 130 at http://avrlab.com