Kod: Zaznacz cały
$regfile = "Attiny2313.dat"
$crystal = 8000000
$eepleave
$hwstack = 40
$swstack = 16
$framesize = 40
'=========================
'=== Rozmiary i zmienne===
'=========================
Dim dlugimp As Word
'=========================
'===Konfiguracje portow===
'=========================
config pinb.5 = input 'przycisk
Config Portb.1 = Output 'wsteczne
Config Portb.2 = Output 'stop
config portd.6 = output 'strobop
config portb.0 = output 'strobol
Config Pinb.7 = Input 'wejscie sygnalu
'====================
'===Aliasy & stale===
'====================
przycisk Alias Pinb.5
wsteczne alias PORTB.1
stopy Alias Portb.2
strobop alias portd.6
strobol alias portb.0
'=============================
'===Ustawienia stanu portow===
'=============================
set przycisk
set wsteczne
set stopy
set strobop
set strobol
reset Pinb.7
'=============================
'====Petla glowna programu====
'=============================
do
pulsein dlugimp , Pinb , 7 , 0
if dlugimp > 1385 then
reset wsteczne
wait 1
set wsteczne
wait 1
end if
if err = 1 then
reset wsteczne
waitms 200
set wsteczne
waitms 200
end if
loopjak tylko przyrównam dlugimp do wartości 1390 to dioda juz przestaje migać. o co chodzi? czemu pulsein nie zlicza prawidłowo?