Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Problem with pulsein.lib

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Emmel

Bascom Member



Joined: 20 Jan 2013
Posts: 3
Location: Konz

germany.gif
PostPosted: Wed Feb 18, 2015 6:49 pm    Post subject: Problem with pulsein.lib Reply with quote

this code produced an error by syntax controll. I don't know why. What can I do? (Sorry for my bad english. I hope you understand me)

<<< error 61: line 57 label not found [_micro_delay] in file ..... pulsein.lib. >>>

$regfile = "m8def.dat"
$crystal = 8000000
$hwstack = 32
$swstack = 40
$framesize = 50
$lib "pulsein.lib"
Config Portb.1 = Input
Config Portb.0 = Output
Config Portb.2 = Output
Const Cpulsein_timeout = 0
dim bPulseIn_Delay as byte
bPulseIn_Delay = 10

Dim Zeitmessung As Word
Dim Entfernung As Word
Do
Pulseout Portb , 0 , 40
Pulsein Zeitmessung , Pinb , 1 , 1

Entfernung = Zeitmessung
If Entfernung > 0 Then
If Entfernung < 5 Then
Portb.2 = 1
Else
Portb.2 = 0
End If
End If
Waitms 100

Loop

(BASCOM-AVR version : 2.0.7.8 )
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5078
Location: Holland

blank.gif
PostPosted: Wed Feb 18, 2015 8:16 pm    Post subject: Reply with quote

there is no label _micro_delay in the pulsein.lib
I advise to check if you use the right version.

the one from mcs is 4791 bytes.

_________________
Mark
Back to top
View user's profile Visit poster's website
Emmel

Bascom Member



Joined: 20 Jan 2013
Posts: 3
Location: Konz

germany.gif
PostPosted: Wed Feb 18, 2015 8:31 pm    Post subject: Reply with quote

Hi,

my Version is from 17.10.2013 23:16 (4,791 KB) I had updated it yesterday.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5078
Location: Holland

blank.gif
PostPosted: Wed Feb 18, 2015 9:37 pm    Post subject: Reply with quote

I had another look.
you need to include this in your code : waitus Bpulsein_delay
it does not matter where.
you use a special variant of the waitus routine because of the variable Bpulsein_delay

_________________
Mark
Back to top
View user's profile Visit poster's website
Emmel

Bascom Member



Joined: 20 Jan 2013
Posts: 3
Location: Konz

germany.gif
PostPosted: Wed Feb 18, 2015 9:53 pm    Post subject: Reply with quote

Thank you,

it's allright.

Greetings
Peter
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum