Getting DS1302 object to run in the attached program
djt
Posts: 19
I have put together a series of modified objects obtained from the object exchange web site. (See attachment 1).The combined modified objects run OK and give me the data I want. ·I now want to add the date and time when the data (Temperature ,REL Humidity· dew point and light readings) are obtained.· I have attempted to incorporate the DS1302 object (See attachment 2) into attachment 1 with no success. ·Attachment 3 shows my current try. What am I doing wrong? Any help would be greately appreciated.
Thank's,· djt
Thank's,· djt
Comments
first use the archive function of the propeller-tool to create a zip-archive that contains ALL *.Spin-files that were needed to compile your project.
You are a lucky guy that I downloaded the other *.SPIN-files from earlier questions you had.
if you take a look into the file DS1392_full-demo you see two initial calls of the object
In your code this initialisation is missing
best regards
Stefan
Thank you for your reply. I probably removed the two items as I was trying to get the program to work and forgot to return them. I've re-installed these items and the program runs. Unfortunately, I think I phrased my original questions incorrectly. The program returns all results including the time and date, but the time and date results are 00:00:00 00 00 00 00.
I have not found how to add the starting time and date to the DS1302_full program. I have added them to the DS1302_full_demo program, but when I use that object (DS1302_full_demo)instead of the DS1302_full object in the SenirionDemoLight1 program I get an error(need Subroutine)·in the following line in the SensirionDemoLight1 program:
····· rtc1.readTime( @hour, @minute, @second )
I am now using an object that has a method in another object. I'm lost!!
I hate to bother you with these questions, but you have been extreemly helpful in the past and I hope you see your way to helping a·neophite·continue to gain knowledge in this fascinating but complex field.
Thank's, djt
do you get 00:00:00 00 00 00 00 ALL the time or only if you start your code
and then it returns
00:00:01 00 00 00 00
00:00:02 00 00 00 00
00:00:03 00 00 00 00
00:00:04 00 00 00 00
....
This file DS1302_full.spin is some kind of a driver that provides functionality to interact with the DS1302-chip.
This file DS1302_full.spin contains the subroutines that YOU have to call to to interact with the DS1302-chip.
Everytime you use an object-file you leave this object-file ITSELF as it is. Never ever do ANY changes to an objectfile ITSELF
The file DS1302_full_demo.spin is a MAIN-program that does calling the subroutines of the file DS1302_full.spin
Inside DS1302_full_demo.spin there is a call of the method rtc.setDatetime
You have to call the method rtc.setDatetime INSIDE of the *.SPIN-file that is YOUR main-program.
Maybe you can imagine objectfiles like DS1302_full.spin as a toolbox with several tools in it.
If you want to use them at a friend you take the toolbox into your car and take it to your friend.
At your friend you take out a tool to use it.
Now to stay in the picture. If you would load into your car the "At your friend you take out a tool" this will surely not work
as you can not "load" an imaterial "doing" into your car. And here the picture is not so good. (but the best I have handy in my mind at the moment)
So again the file DS1302_full.spin is the toolbox containing the tools.
DS1302_full_demo.spin is the house of person A with the toolbox DS1302_full.spin to use it in the house of Person A
SensirionDemoLight1.spin is YOUR house and you have to buy a toolbox of type DS1302_full.spin and put it into YOUR house so that you have
all tools of DS1302_full.spin handy.
If you want to know what tools the toolbox DS1302_full.spin has you have to open the file DS1302_full.spin and take a look inside.
Now here the analogon "toolbox" does not fit in every detail.
inside The file DS1302_full.spin you find the following methods (subroutines)
from these you only need
ATTENTION the above lines are the DEFINITION of the tools NOT the USE of them.
How you USE them is shown in the file DS1302_full_demo.spin
the other PUB-methods are sub-sub-routines (like small parts of a complex tool) that are nescessary for the function of the tool but you use the tool as a WHOLE thing and not some small parts of it
by the way
did you work through the Propeller Education Kit Labs Fundamentals Version 1.1
found here C:\Program Files\Parallax Inc\Propeller Tool v1.2.6\Examples\PE Kit\Propeller Education Kit Labs-Fundamentals v1.1.pdf
If not it is highly recommended as you leaved the area of small blinking programs long ago and work with programs complex like this
best regards
Stefan