Counting Sheep
dbj
Posts: 75
Hey , Wow I realy can't see the forest for the trees!! Trying to write some· code to count days 1,2,3 """ect,. ·I dont Understand why this won't work ! its like it stops looping back to the do
I have a ds1302 on a BS24P·to keep time just trying to count up from 1 to 365,
I have tried getting the days of year julian but can't seem to figure it out, went ·to Tracy Allen's web page but cant make it work either , Just trying something simple. Thanks
········· ' {$STAMP BS2p}
········· ' {$PBASIC 2.5}
········ X······· VAR···· Word
········ Main:
········· DO
········ PAUSE 200
········ IF hrs = 24 THEN
······· GOSUB keep
········ ELSE
········· GOTO Main
·········· ENDIF
············ LOOP
·············· keep:
················ X = 1 + X
·
I have a ds1302 on a BS24P·to keep time just trying to count up from 1 to 365,
I have tried getting the days of year julian but can't seem to figure it out, went ·to Tracy Allen's web page but cant make it work either , Just trying something simple. Thanks
········· ' {$STAMP BS2p}
········· ' {$PBASIC 2.5}
········ X······· VAR···· Word
········ Main:
········· DO
········ PAUSE 200
········ IF hrs = 24 THEN
······· GOSUB keep
········ ELSE
········· GOTO Main
·········· ENDIF
············ LOOP
·············· keep:
················ X = 1 + X
·
Comments
But yes, that GOSUB Keep, where Keep: has no return anywhere is not good.
That program never made it through the PBASIC IDE without errors, for one thing. The variable "hrs" is neither defined, nor is it used any where. Try to write a program that at least passes through the PBASIC IDE without errors, and we can go from there.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->