<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=12&amp;t=4659&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2013-11-03T21:44:58+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=12&amp;t=4659&amp;mode</id>
<entry>
<author><name><![CDATA[Jacek]]></name></author>
<updated>2013-11-03T21:44:58+01:00</updated>
<published>2013-11-03T21:44:58+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55306#p55306</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55306#p55306"/>
<title type="html"><![CDATA[Re: Instrukcja Encoder i baragraf]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55306#p55306"><![CDATA[
Witam - działa polecenie encoder - kręcąc enkoderem zmieniam częstotliwość OCR1A - reguluje prędkość silnika krokowego - pozdrawiam Jacek.<br /><br />[syntax=basic4gl]$regfile = &quot;m32def.dat&quot;<br />$crystal = 16000000<br />$hwstack = 40<br />$swstack = 20<br />$framesize = 16<br /><br /> Config Timer0 = Timer , Prescale = 256<br />Enable Timer0 : On Timer0 Prztimer0<br />Config Timer1 = Timer , Prescale = 64 , Clear Timer = 1 , Compare A = Toggle<br />Enable Interrupts<br /><br />Start Timer1<br />On Compare1a Timer1_isr<br />Enable Timer1<br />Enable Compare1a<br />Enable Interrupts<br /><br />Config Graphlcd = 240 * 128 , Dataport = Portc , Controlport = Porta , Ce = 2 , Cd = 3 , Wr = 4 , Rd = 5 , Reset = 6 , Fs = 10 , Mode = 6<br /><br />Config Adc = Single , Prescaler = Auto , Reference = Avcc<br /><br />Dim Odczyt_adc0 As Word<br />Dim Srednia_adc0 As Long<br />Dim Wynik_adc0 As Word<br />Dim Krok_adc0 As Byte<br />Dim Dol_adc0 As Bit<br />Dim Stop_adc0 As Bit<br />Dim Gora_adc0 As Bit<br />Dim Licz_speed As Byte<br />Dim Dol_e As Byte<br />Dim Gora_e As Byte<br />Config Portd.0 = Input<br />Set Pind.0<br />Config Portd.1 = Input<br />Set Portd.1<br />Config Portd.6 = Output<br />Config Portd.7 = Output<br />Set Portd.6<br />Reset Portd.7<br />Config Portd.2 = Input<br />Config Portd.3 = Input<br />Set Portd.2<br />Set Portd.3<br />Dim E As Long                                               'zmienna odczytu z enkodera lewy wskaźnik<br />Dim F As Long                                               'zmienna odczytu z enkodera prawy wskaźnik<br />Dim A As Long                                               'zmiennna pomocnicz odczytu enkodera<br />Dim B As Single<br />Dim C As Single<br />Dim D As Single<br />Dim Dzielnik(3) As Byte                                     'dzielniki timera<br />Dim Flaga_4ms As Bit , Flaga_100ms As Bit , Flaga_500ms As Bit , Flaga_1s As Bit       'flagi przerwa?<br />Dim Enkoder As Byte<br />Pind.0 Alias Kanal_a<br />Pind.1 Alias Kanal_b<br />Set Portd.0<br />Set Portd.1<br /><br />Gora_adc0 = 0<br />Dol_adc0 = 0<br />Stop_adc0 = 1<br />Dol_e = 0<br />Gora_e = 0<br /><br />E = 0<br />F = 0<br />Start Adc<br />Ocr1a = 777                                                 'Ocr1a = 50<br />Stop Timer1<br />Cursor Off<br />Cls<br />Locate 1 , 1 : Lcd &quot;TEST REGULACJI&quot;<br /><br /><br />Wait 1<br />Start Timer1<br />'Timer1 = 5000<br />Cls<br />Do<br />'================================================== flaga 4_ms<br />If Flaga_4ms = 1 Then<br />   Flaga_4ms = 0<br />      Gosub Wyswietlanie<br />      Gosub Ktory_kierunek<br />      Gosub Odczyt_enkoder<br />      Gosub Kierunek<br />      Gosub Predkosc<br />      'Gosub Pom_adc0<br />End If<br />'================================================== flaga 100_ms<br />If Flaga_100ms = 1 Then<br />   Flaga_100ms = 0<br /><br />   'Gosub Pom_adc0<br />End If<br />'================================================== flaga 500_ms<br />If Flaga_500ms = 1 Then<br />   Flaga_500ms = 0<br /><br /><br />End If<br />'================================================== flaga 1_s<br />If Flaga_1s = 1 Then<br />   Flaga_1s = 0<br /><br />   End If<br /><br /><br /><br /><br /> Loop<br />End<br />'==================================================================<br />Odczyt_enkoder:<br /><br />Enkoder = Encoder(pind.0 , Pind.1 , Prawo , Lewo , 1)<br /><br />Return<br />'==================================================================<br />Prawo:<br /><br />Start Timer1<br />Ocr1a = Ocr1a - 1<br />If Ocr1a &lt;= 77 Then<br />   Ocr1a = 77<br />  End If<br /><br /><br />'Dol_e = Dol_e + 1<br />'Incr Dol_e<br />'If Dol_e =&gt; 250 Then<br />'   Dol_e = 250<br />'  End If<br />'Decr Gora_e<br />'If Gora_e = 0 Or Gora_e &gt; 250 Then<br />'   Gora_e = 0<br />'  End If<br /><br />Return<br />'=================================================================<br />Lewo:<br /><br />Start Timer1<br />Ocr1a = Ocr1a + 1<br />If Ocr1a =&gt; 777 Then<br />   Ocr1a = 777<br />  End If<br /><br />'Incr Gora_e<br />'If Gora_e =&gt; 250 Then<br />'   Gora_e = 250<br />'  End If<br />'Decr Dol_e<br />'If Dol_e = 0 Or Dol_e &gt; 250 Then<br />'   Dol_e = 0<br />'  End If<br /><br />Return<br />'======================================================<br />'Pom_adc0:<br /><br />'For Krok_adc0 = 1 To 100<br />'Odczyt_adc0 = Getadc(0)<br />'Srednia_adc0 = Srednia_adc0 + Odczyt_adc0<br />'Next Krok_adc0<br />'Srednia_adc0 = Srednia_adc0 / 100<br /><br /><br />'Return<br />'======================================================<br />Wyswietlanie:<br /><br />Locate 1 , 1 : Lcd &quot;ADC(0) &quot; ; Odczyt_adc0 ; &quot;   &quot;<br />Locate 3 , 1 : Lcd &quot;OCR1A  &quot; ; Ocr1a ; &quot;  &quot;<br />Locate 4 , 1 : Lcd &quot;GORA &quot; ; Gora_adc0<br />Locate 5 , 1 : Lcd &quot;DOL  &quot; ; Dol_adc0<br />Locate 6 , 1 : Lcd &quot;STOP &quot; ; Stop_adc0<br />'Locate 2 , 1 : Lcd &quot;WYNIK_ADC0 &quot; ; Srednia_adc0 ; &quot;   &quot;<br />Locate 7 , 1 : Lcd &quot;LICZ_SPEED &quot; ; Licz_speed<br />Locate 8 , 1 : Lcd &quot;dol_E &quot; ; Dol_e ; &quot;  &quot;<br />Locate 9 , 1 : Lcd &quot;gora_E &quot; ; Gora_e ; &quot;   &quot;<br /><br /><br />Return<br />'====================================================================<br />Timer1_isr:<br />'Incr Dystans<br /><br />Return<br />'===============================================================<br />Ktory_kierunek:<br /><br />If Odczyt_adc0 &lt; 475 Then<br />   Gora_adc0 = 1<br />   Dol_adc0 = 0<br />   Stop_adc0 = 0<br />      Elseif Odczyt_adc0 &gt; 549 Then<br />      Gora_adc0 = 0<br />      Dol_adc0 = 1<br />      Stop_adc0 = 0<br />   Else<br />   Gora_adc0 = 0<br />   Dol_adc0 = 0<br />   Stop_adc0 = 1<br />End If<br /><br />Return<br />'=======================================================================<br />Kierunek:<br /><br />'If Gora_adc0 = 1 Then<br />'   Start Timer1<br />'   Decr Licz_speed<br />'   If Licz_speed =&gt; 100 Then<br />'   Licz_speed = 100<br />'   Ocr1a = Ocr1a - 10<br />'   End If<br />'   If Ocr1a &lt;= 77 Then<br />'   Ocr1a = 77<br />'   End If<br />'   'Ocr1a = 389<br />'   Set Portd.6<br />'   Reset Portd.7<br />'      Elseif Dol_adc0 = 1 Then<br />'         Start Timer1<br />'         Decr Licz_speed<br />'         If Licz_speed =&gt; 100 Then<br />'         Licz_speed = 100<br />'          Ocr1a = Ocr1a - 10<br />'          End If<br />'         'Ocr1a = 389<br />'         Reset Portd.6<br />'         Reset Portd.7<br />'      Else<br />'         Stop Timer1<br />'         Ocr1a = 38<br />'      'End If<br />'  End If<br /><br />Return<br />'==================================================================<br />Predkosc:<br /><br />'Start Timer1<br />'Ocr1a = Ocr1a - Dol_e<br />'If Ocr1a =&gt; 777 Then<br />'   Ocr1a = 777<br />'  End If<br /><br />Return<br />'==================================================================<br /> Prztimer0:<br />  Timer0 = 5<br />  Set Flaga_4ms<br />  Incr Dzielnik(1)<br />  If Dzielnik(1) = 25 Then<br />    Dzielnik(1) = 0<br />    Set Flaga_100ms<br />    Incr Dzielnik(2)<br />    If Dzielnik(2) = 5 Then<br />      Dzielnik(2) = 0<br />      Set Flaga_500ms<br />      Incr Dzielnik(3)<br />      If Dzielnik(3) = 2 Then<br />         Dzielnik(3) = 0<br />         Set Flaga_1s<br />         End If<br />    End If<br />  End If<br />Return[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=193">Jacek</a> — 3 lis 2013, o 21:44</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[jacekk232]]></name></author>
<updated>2013-11-03T21:18:33+01:00</updated>
<published>2013-11-03T21:18:33+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55305#p55305</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55305#p55305"/>
<title type="html"><![CDATA[Re: Instrukcja Encoder i baragraf]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55305#p55305"><![CDATA[
Wkleiłeś taki kawał kodu a nie chcesz zaśmiecać forum kilkoma linijkami. Najlepiej jakbyś te parę linii kodu od enkodera też wkleił. Oczywiście razem z resztą kodu.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=204">jacekk232</a> — 3 lis 2013, o 21:18</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[slawek3000]]></name></author>
<updated>2013-11-03T21:07:37+01:00</updated>
<published>2013-11-03T21:07:37+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55302#p55302</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55302#p55302"/>
<title type="html"><![CDATA[Re: Instrukcja Encoder i baragraf]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55302#p55302"><![CDATA[
hmm... wiesz nie chcę zaśmiecać forum paroma liniami kodu jak jest on napisany w helpie Bascomu <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":-)" title="Szczęśliwy" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=988">slawek3000</a> — 3 lis 2013, o 21:07</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[jacekk232]]></name></author>
<updated>2013-11-03T20:44:15+01:00</updated>
<published>2013-11-03T20:44:15+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55298#p55298</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55298#p55298"/>
<title type="html"><![CDATA[Re: Instrukcja Encoder i baragraf]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55298#p55298"><![CDATA[
Jesteś pewien, że wkleiłeś dobry kod? Bo nigdzie w nim nie widzę żadnej zmiennej Long ani jakichkolwiek bascomowych poleceń do obsługi encodera.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=204">jacekk232</a> — 3 lis 2013, o 20:44</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[slawek3000]]></name></author>
<updated>2013-11-03T07:21:52+01:00</updated>
<published>2013-11-03T07:21:52+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55228#p55228</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55228#p55228"/>
<title type="html"><![CDATA[Instrukcja Encoder i baragraf]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=4659&amp;p=55228#p55228"><![CDATA[
Witam, pisze sobie program, na A128 i nie nie umie sobie poradzić z jednym problemem ... wykorzystuje instrukcję koder Jaka Jest w bascomie zrobić zliczania zmiennej Long + - i jednocześnie dokonuje pomiaru napięcia V kod programu<br /><br />[syntax=basic4gl]'--------------------------------------------------------------------------------<br />'name                     : BG30dB_LCD.bas<br />'copyright                : (c) 1995-2005, MCS Electronics<br />'purpose                  : create a logarithmic LCD bar graph dB (VU) meter<br />'micro                    : AT90S2313-10<br />'suited for demo          : yes<br />'commercial addon needed  : no<br />'use in simulator         : possible<br />'<br />' Author     : Ger langezaal<br />'<br />'---&#91; Small program description &#93;-----------------------------------------------------<br />'<br />' This program is written to create a logarithmic LCD bar graph dB (VU) meter<br />' on a 16x2 LCD display with peak-hold and drop-down.<br />' Custom characters are designed with the LCD Designer in BASCOM-AVR.<br />' The upper row is a scale from +6dB to -24dB with 2dB markers.<br />' The lower row is the bar graph with peak-hold and drop-down.<br />' Log conversion is done with the analog comparator on a RC discharge curve.<br />' C1 is charged every 4mS with PB0 as output on a Timer0 Interrupt.<br />' Then PB0 is set to AIN0 (analog comparator +input) Timer1 is reset<br />' and start counting, C1 will be discharged by R1.<br />' Timer1 is counting until AIN0 &lt; AIN1.<br />' Analog Comparator Output = ACSR bit 5.<br />' Timer1 value is stored in T1 for calculation.<br />'<br />'---&#91; LCD display &#93;-------------------------------------------------------------<br />'<br />' Display     : LCD 16 x 2<br />' Scale range : 30dB (+6dB to -24dB)<br />' Resolution  : 2dB<br />'<br />' The LCD display is connected in PIN mode.<br />' See also BASCOM-AVR Index:<br />'     'Attaching an LCD Display' and 'AT90S2313' for pin numbers<br />'<br />'   LCD pin  -  AVR<br />'<br />'   Vss  1   -  GND<br />'   Vdd  2   -  VCC +5 Volt<br />'   Vo   3   -  0-VCC     Contrast<br />'   RS   4   -  PB2<br />'   RW   5   -  GND<br />'   E    6   -  PB3<br />'   Db0  7   -  GND<br />'   Db1  8   -  GND<br />'   Db2  9   -  GND<br />'   Db3  10  -  GND<br />'   Db4  11  -  PB4<br />'   Db5  12  -  PB5<br />'   Db6  13  -  PB6<br />'   Db7  14  -  PB7<br />'<br />'---&#91; Analog comparator inputs &#93;------------------------------------------------<br />'<br />'<br />'  Meter DC input &gt;-------&#91; R2 &#93;-------&gt; Pb0 (AIN1 )<br />'                                 |<br />'             GND &lt;---------||-----<br />'                           C2<br />'<br />'                      ---&#91; R1 &#93;---<br />'             GND &lt;----|          |----&gt; Pb1 (AIN0 )<br />'                      -----||-----<br />'                           C1<br />' R1 = 10k 5%<br />' R2 = 10k<br />' C1 = 47nF 5%<br />' C2 = 47nF<br />'<br />'---&#91; DC input versus Timer1 and Bar position &#93;---------------------------------<br />'<br />' Measured Timer1 values for calculation:<br />' DC input = 3500mV  Timer1 =  192   ( +6dB)<br />' DC input =  350mV  Timer1 = 1482   (-14dB)   20dB = factor 10<br />' 20dB = 1482 - 192 = 1290 Timer1 counts<br />'  2dB = 1290 / 10 = 129 Timer1 counts<br />'<br />' Calculated Values:<br />'  Input mV    Timer1   dB Scale   Bar pos<br />'   3500         192       +6        16<br />'   2780         321       +4        15<br />'   2208         450       +2        14<br />'   1754         579        0        13<br />'   1393         708       -2        12<br />'   1106         837       -4        11<br />'    879         966       -6        10<br />'    698        1095       -8         9<br />'    554        1224       -10        8<br />'    440        1353       -12        7<br />'    350        1482       -14        6<br />'    278        1611       -16        5<br />'    221        1740       -18        4<br />'    175        1869       -20        3<br />'    139        1998       -22        2<br />'    111        2127       -24        1<br />'   &lt;111       &gt;2127     infinit     1/2 Bar<br />'<br />'---&#91; Compiler and hardware related statements &#93;--------------------------------<br /><br />$regfile = &quot;m128def.dat&quot;<br />'$regfile = &quot;m644pdef.dat&quot;                                   ' specify the used micro<br />$crystal = 16000000                                         'default use 40 for the frame space<br /><br /><br />Config Lcd = 16 * 4<br />Config Lcdpin = Pin , Db4 = Porta.4 , Db5 = Porta.5 , Db6 = Porta.6 , Db7 = Porta.7 , E = Porta.3 , Rs = Porta.2<br /><br />Ddre = &amp;B10111111                                           'set PB0 and PB1 as inputs<br />Porte.2 = 0                                                 'disable PB0 input pullup<br />Porte.3 = 0                                                 'disable PB1 input pullup<br /><br />Ddrd = &amp;B10111111                                           'config PD6 as input<br />Portd = &amp;B11111111                                          'output high and enable input pullup<br /><br />Acsr.7 = 0                                                  'enable analog comparator (bit 7 = 0)<br /><br />'---&#91; Variables &#93;---------------------------------------------------------------<br /><br />Dim Char_pos As Byte<br />Dim Peak_pos As Byte<br />Dim Peak_hold As Byte<br />Dim Drop_hold As Byte<br />Dim Bar_len As Word<br />Dim T1 As Word<br /><br />'---&#91; Constants &#93;---------------------------------------------------------------<br /><br />Const Peak_hold_time = 250<br />Const Drop_down_time = 50<br />Const Char_max = 16                                         'number of LCD characters (one row)<br />Const T1_fs = 192                                           'full scale Timer1 value<br />Const T1_step = 129                                         '2dB step Timer1  value<br />Const T1_range = T1_step * Char_max + T1_fs                 'Calculate Timer1 range<br /><br />Ac_out Alias Acsr.5                                         'analog comparator output = ACSR bit 5<br /><br />'---&#91; Custom LCD characters &#93;---------------------------------------------------<br /><br />Deflcdchar 0 , 12 , 18 , 18 , 18 , 12 , 32 , 04 , 04        ' 0<br />Deflcdchar 1 , 02 , 06 , 02 , 02 , 07 , 32 , 32 , 04        ' 1<br />Deflcdchar 2 , 06 , 09 , 02 , 04 , 15 , 32 , 32 , 04        ' 2<br />Deflcdchar 3 , 32 , 32 , 07 , 32 , 32 , 32 , 32 , 04        ' -<br />Deflcdchar 4 , 32 , 32 , 32 , 32 , 32 , 32 , 32 , 04        ' Scale marker<br />Deflcdchar 5 , 27 , 27 , 27 , 27 , 27 , 27 , 27 , 32        ' bar<br />Deflcdchar 6 , 24 , 24 , 24 , 24 , 24 , 24 , 24 , 32        ' 1/2 left bar<br />Deflcdchar 7 , 06 , 05 , 14 , 21 , 14 , 32 , 32 , 04        ' dB<br />Cls                                                         'select LCD data RAM<br />Cursor Off<br /><br />'---&#91; Timer Configuration &#93;-----------------------------------------------------<br /><br />Config Timer0 = Timer , Prescale = 256                      'On Interrupt Timer<br />Config Timer1 = Timer , Prescale = 8                        'R/C Timer<br />Config Watchdog = 2048<br />Enable Interrupts<br />Enable Timer0<br />Enable Timer1<br />On Timer0 Dc_input_sample                                   'goto subroutine<br />Timer0 = 0<br />Timer1 = 0<br />Start Timer0<br />Start Timer1<br /><br />'---&#91; Show software revision &#93;--------------------------------------------------<br /><br />Lcd &quot;BAR GRAPH 30dB&quot;<br />Locate 2 , 1<br />Lcd &quot;METER  Rev.1.0&quot;<br />Waitms 1000<br />Cls<br /><br />'---&#91; Draw dB Scale with custom characters &#93;------------------------------------<br /><br />Locate 1 , 1 : Lcd Chr(3) ; Chr(2) ; Chr(0) ; Chr(4) ; Chr(4) ; Chr(3)<br />Locate 1 , 7 : Lcd Chr(1) ; Chr(0) ; Chr(4) ; Chr(4) ; Chr(4) ; Chr(4)<br />Locate 1 , 13 : Lcd Chr(0) ; Chr(4) ; Chr(4) ; Chr(7)<br /><br />'---&#91; Main program loop &#93;-------------------------------------------------------<br /><br />Do<br />  Locate 2 , 1                                              'set LCD first character position<br /><br />  If Bar_len = 0 Then<br />    If Peak_pos = 0 Then Lcd Chr(6)                         'print 1/2 left bar for infinit<br />  End If<br /><br />  For Char_pos = 1 To Char_max                              'number of characters<br />    If Char_pos &lt;= Bar_len Then                             'print one bar<br />      Lcd Chr(5)                                            '<br />    Elseif Char_pos = Peak_pos Then                         'print peak bar<br />      Lcd Chr(5)                                            '<br />    Else<br />      Lcd Chr(32)                                           'print spaces to fill row<br />    End If<br />  Next<br />Loop<br /><br />'-------------------------------------------------------------------------------<br />End<br />'-------------------------------------------------------------------------------<br /><br />'---&#91; Interrupt Service Routine on Timer0 overflow  &#93;---------------------------<br /><br />Dc_input_sample:<br />  Timer0 = 100                                              'preset Timer0 for sample rate of 4mS<br /><br />  Ddre.2 = 1                                                'set AIN0 as PB0 output<br />  Porte.2 = 1                                               'set PB0 high to charge C1<br />  Waitus 200                                                'wait for charge complete<br />  Ddre.2 = 0                                                'reset PB0 as AIN0 analog input<br />  Porte.2 = 0                                               'disable AIN0 pullup<br /><br />  Timer1 = 0                                                'clear R/C Timer1<br />  Bitwait Ac_out , Reset                                    'wait for AIN0 &lt; AIN1<br />  T1 = Timer1                                               'read Timer1 value<br /><br />  If T1 &lt; T1_fs Then                                        'check T1 low limit<br />    T1 = T1_fs                                              'T1 clipping<br />  Elseif T1 &gt; T1_range Then                                 'check T1 high limit<br />    T1 = T1_range                                           'T1 clipping<br />  End If<br /><br />  Bar_len = T1_range - T1                                   'calculate bar length<br />  Bar_len = Bar_len \ T1_step                               '<br /><br />  If Bar_len &gt;= Peak_pos Then                               'new peak value<br />    Peak_pos = Bar_len                                      'store peak value<br />    Peak_hold = Peak_hold_time                              'preset peak hold timer<br />  Else<br />    If Peak_hold &gt; 0 Then<br />      Decr Peak_hold<br />    Else<br />      If Drop_hold &gt; 0 Then<br />        Decr Drop_hold<br />      Else<br />        Drop_hold = Drop_down_time                          'preset drop down timer<br />        If Peak_pos &gt; 0 Then Decr Peak_pos                  'drop down one position<br />      End If<br />    End If<br />  End If<br />  Reset Watchdog<br />Return[/syntax]<br /><br />podczas działania tego programu encoder nie działa prawidłowo ponieważ zlicza mi tylko do zwiększanie zmiennej LONG natomiast nie zlicza zmniejszenia zmiennej LONG co może być przyczyną ?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=988">slawek3000</a> — 3 lis 2013, o 07:21</p><hr />
]]></content>
</entry>
</feed>