Melanies RTC code has broken


Results 1 to 3 of 3

Threaded View

  1. #2
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default Sorry Melanie...its me !!!!

    Sorry Melanie !!!

    Your code is NOT WRONG

    I tried re-creating the formula in an Excel spreadsheed forcing results to be INT but it threw up wrong results all over the place.

    I then took an alternative approace of getting the PIC to output its information so that I could stick it into a spreadsheet. I then got Excel to calculate the correct weekday for each of the dates. I cant see ANY discrepancies in the 7000+ rows although I havent looked at each one individually.

    Here is the section containing the dates that I posted last night....

    Code:
    Date		Weekday	DayID	RealDay
    
    9-Sep-2006	Sat	5	Saturday
    10-Sep-2006	Sun	6	Sunday
    11-Sep-2006	Mon	7	Monday
    12-Sep-2006	Tue	1	Tuesday
    13-Sep-2006	Wed	2	Wednesday
    14-Sep-2006	Thu	3	Thursday
    15-Sep-2006	Fri	4	Friday
    16-Sep-2006	Sat	5	Saturday
    17-Sep-2006	Sun	6	Sunday
    18-Sep-2006	Mon	7	Monday
    19-Sep-2006	Tue	1	Tuesday
    20-Sep-2006	Wed	2	Wednesday
    21-Sep-2006	Thu	3	Thursday
    22-Sep-2006	Fri	4	Friday
    23-Sep-2006	Sat	5	Saturday
    24-Sep-2006	Sun	6	Sunday
    25-Sep-2006	Mon	7	Monday
    26-Sep-2006	Tue	1	Tuesday
    27-Sep-2006	Wed	2	Wednesday
    28-Sep-2006	Thu	3	Thursday
    29-Sep-2006	Fri	4	Friday
    30-Sep-2006	Sat	5	Saturday
    1-Oct-2006	Sun	6	Sunday
    2-Oct-2006	Mon	7	Monday
    3-Oct-2006	Tue	1	Tuesday
    4-Oct-2006	Wed	2	Wednesday
    5-Oct-2006	Thu	3	Thursday
    6-Oct-2006	Fri	4	Friday
    7-Oct-2006	Sat	5	Saturday
    8-Oct-2006	Sun	6	Sunday
    Date, Weekday and DayID are what I got from the PIC.

    RealDay is using the =TEXT(value,"dddd") function in Excel

    What I cant figure out is that this is the SAME PROGRAM with just a small section of code copied into a separate subroutine to generate the dates for this test.

    As you can see, 6-OCT-2006 gets generated as "FRI" but when I use the date setting routine in my program I end up with "SUN".

    Will investigate further but it look like I was predicting the end of the world prematurely. Apologies to Melanie
    Last edited by keithdoxey; - 6th October 2006 at 13:19.
    Keith

    www.diyha.co.uk
    www.kat5.tv

Similar Threads

  1. Broken code
    By sinoteq in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 2nd December 2014, 13:17
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. X1226 RTC - Help
    By charudatt in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th August 2006, 17:54

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts