Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

DCF 77 Assign a Variable

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

Bascom Member



Joined: 08 Sep 2022
Posts: 7

PostPosted: Fri Nov 25, 2022 5:07 pm    Post subject: DCF 77 Assign a Variable Reply with quote

I have build a dcf 77 clock which is working. I want to extend the program with zodiac signs. Therefore I want to assign a 2 Variables - Tag and Monat. I have tried it many times but it is not working.

Here is a small excerpt from the program:

    Dim Tag as Byte
    Dim Monat as Byte

    Wochentag:
    Wochentag = Dayofweek() '0=Mo 1=Di ... 6=So
    Locate 1 , 1
    Lcd " " ; Lookupstr(wochentag , Wochentage)
    ' Datum:
    Lcd _day ; "." ; Lookupstr(_month , Monate) ; " 20" ; _year ; " "
    ' Lcd Date$ 'geht auch tt.mm.jj

    ' Uhrzeit:
    Locate 2 , 1 : Lcd " " ; Time$

    ' Empfang o.k. Symbol:
    Locate 2 , 16
    If Synchron = 1 Then
    Lcd Chr(0) 'DCF o.k.
    Else
    Lcd " " 'DCF nicht o.k.
    End If
    End If
    Return


When I write:

_day = Tag
_month = Monat

it doesn`t work. How can I solve this problem. Thank you

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

Administrator



Joined: 09 Apr 2004
Posts: 5657
Location: Holland

blank.gif
PostPosted: Fri Nov 25, 2022 5:27 pm    Post subject: Reply with quote

you need to use the internal dcf variables : dcf_month and dcf_day
_________________
Mark
Back to top
View user's profile Visit poster's website
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2105

blank.gif
PostPosted: Fri Nov 25, 2022 6:02 pm    Post subject: Reply with quote

albertsm wrote:
you need to use the internal dcf variables : dcf_month and dcf_day

They way the TO assigns the variables, it would alter the internal ones.
Quote:
When I write:
_day = Tag
_month = Monat

Hopefully this does not result in a feedback-loop and thus alter the time/date of the Mainflingen-transmitter. Very Happy Very Happy Very Happy
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5657
Location: Holland

blank.gif
PostPosted: Fri Nov 25, 2022 6:24 pm    Post subject: Reply with quote

yes , the variables should be read, not assigned.
my dcf77 received from conrad is still working perfect.

one tip : do not put the module near your monitor.

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

Bascom Member



Joined: 08 Sep 2022
Posts: 7

PostPosted: Mon Nov 28, 2022 8:44 am    Post subject: DCF 77 Assign a Variable Reply with quote

Today I have tested it and it works
Thank you
Very Happy
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