View previous topic :: View next topic |
Author |
Message |
Emmel
Joined: 20 Jan 2013 Posts: 3 Location: Konz
|
Posted: Wed Feb 18, 2015 6:49 pm Post subject: Problem with pulsein.lib |
|
|
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Wed Feb 18, 2015 8:16 pm Post subject: |
|
|
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 |
|
|
Emmel
Joined: 20 Jan 2013 Posts: 3 Location: Konz
|
Posted: Wed Feb 18, 2015 8:31 pm Post subject: |
|
|
Hi,
my Version is from 17.10.2013 23:16 (4,791 KB) I had updated it yesterday. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Wed Feb 18, 2015 9:37 pm Post subject: |
|
|
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 |
|
|
Emmel
Joined: 20 Jan 2013 Posts: 3 Location: Konz
|
Posted: Wed Feb 18, 2015 9:53 pm Post subject: |
|
|
Thank you,
it's allright.
Greetings
Peter |
|
Back to top |
|
|
|