PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Compiler findet Labels nicht???



EDatabaseError
06.09.2006, 18:22
Ich habe von den BASCOM Demos ein Beispiel zum DS1307 folgenden Code:



'-------------------------------------------------------------------------------
' DS1307.BAS
' shows how to use the ds1307 clock on the 2313 futurlec board
' it also shows the CONFIG CLOCK=USER option
'-------------------------------------------------------------------------------
$regfile = "2313def.dat"
$crystal = 8000000
$baud = 19200
$lib "mcsbyte.lbx" ' for smaller code
$lib "ds1307clock.lib" ' modified lib

'configure the scl and sda pins
Config Sda = Portd.6
Config Scl = Portd.5

'address of ds1307
Const Ds1307w = &HD0 ' Addresses of Ds1307 clock
Const Ds1307r = &HD1

Config Clock = User ' this will dim the bytes automatic
'dim other needed variables
Dim Weekday As Byte

Print "DS1307"
Waitms 100
' assigning the time will call the SetTime routine
Time$ = "23:58:59" ' to watch the day changing value
Date$ = "11-13-02" ' 13 november 2002
Do
Print "Date Time : " ; Date$ ; " " ; Time$
Waitms 500
Loop

End

'called from ds1307clock.lib
Getdatetime:
I2cstart ' Generate start code
I2cwbyte Ds1307w ' send address
I2cwbyte 0 ' start address in 1307

I2cstart ' Generate start code
I2cwbyte Ds1307r ' send address
I2crbyte _sec , Ack
I2crbyte _min , Ack ' MINUTES
I2crbyte _hour , Ack ' Hours
I2crbyte Weekday , Ack ' Day of Week
I2crbyte _day , Ack ' Day of Month
I2crbyte _month , Ack ' Month of Year
I2crbyte _year , Nack ' Year
I2cstop
_sec = Makedec(_sec) : _min = Makedec(_min) : _hour = Makedec(_hour)
_day = Makedec(_day) : _month = Makedec(_month) : _year = Makedec(_year)
Return

Setdate:
_day = Makebcd(_day) : _month = Makebcd(_month) : _year = Makebcd(_year)
I2cstart ' Generate start code
I2cwbyte Ds1307w ' send address
I2cwbyte 4 ' starting address in 1307
I2cwbyte _day ' Send Data to SECONDS
I2cwbyte _month ' MINUTES
I2cwbyte _year ' Hours
I2cstop
Return

Settime:
_sec = Makebcd(_sec) : _min = Makebcd(_min) : _hour = Makebcd(_hour)
I2cstart ' Generate start code
I2cwbyte Ds1307w ' send address
I2cwbyte 0 ' starting address in 1307
I2cwbyte _sec ' Send Data to SECONDS
I2cwbyte _min ' MINUTES
I2cwbyte _hour ' Hours
I2cstop
Return
Funktioniert!

Wenn ich den Code nun 1 zu 1 in ein bestehendes Projekt stecke bekomme ich folgende Errors:

Error 61:
Line: 696
Label not Found:
_PRINTLONG

Error 61:
Line: 696
Label not Found:
_PRINTSDECW

Error 61:
Line: 696
Label not Found:
_PRINTLONG

Error 61:
Line: 696
Label not Found:
_PRINTLONG

Line 695 ist die Letzte Zeile in dem Projekt. (kommentar)


Was ist da los?

Mfg

PicNick
06.09.2006, 19:17
Ich glaub, das solltest du mal auskommentieren.
$lib "mcsbyte.lbx"

EDatabaseError
06.09.2006, 19:21
Der Fehler ist weg :shock:

Danke

Tobi

Gador
07.11.2006, 13:54
Was macht man denn wenn man zB RC5 benutzen möchte?
Habe den Fehler nämlich auch

PicNick
07.11.2006, 13:59
Öööhmm, inwiefern hängt das zusammen ?

Gador
07.11.2006, 16:17
Ich hatte gedacht, dass man die mcsbyte.lbx für die RC5 funktion braucht.
Hab den RC5 Code hier im Forum nur damit gefunden.

Hab aber eben rausgefunden, dass man sie nicht braucht :-b

Bringt mich aber zu der Frage wozu denn nun da ist?

magnetix48
07.11.2006, 16:26
Aus dem Bascom Manual:

'when only bytes are used, use the following lib for smaller code
$lib "mcsbyte.lib"

Genaueres ab Seite 694

Gruß
Detlef

Gador
07.11.2006, 16:44
Danke für die Antwort O:)