Serial data transmission period


Results 1 to 11 of 11

Threaded View

  1. #8
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Re: Serial data transmission period

    It is my bad.
    (TimeM//6) may take another 2,3,4,5 minutes depending on the minute value

    You may want use "Second". Example;

    Code:
    SendFlag var bit
    
    Begin:
    
    Sendflag = 0
    
    Main:
    
    If (TimeM//5) = 0 then 
      if RTCsec = 0 and SendFlag = 0 then
         Hserout [hex2 RTCHour,":",hex2 RTCMin," ",DEC(TempC/10),".",#TempC dig 1,13,10]
         sendflag = 1
      ELSE
         If RTCsec > 0 then SendFlag = 0 
      ENDIF
    ENDIF
    or another way could be to use DIG ;

    Code:
    SendFlag var bit
    
    Begin:
    
    Sendflag = 0
    
    Main:
    
    SELECT CASE TimeM DIG 0
    
      Case 0,5    ' Every 5 minutes.
    
         if SendFlag = 0 then
            Hserout [hex2 RTCHour,":",hex2 RTCMin," ",DEC(TempC/10),".",#TempC dig 1,13,10]
            sendflag = 1
        ENDIF
    
      case 1,6    ' Reset flag 1 minute later.
        SendFlag = 0 
    
    END SELECT
    
    This one looks cleaner for my eyes.
    Last edited by sayzer; - 10th January 2018 at 17:53.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. serial in data needs nib
    By l_gaminde in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 4th June 2011, 12:20
  2. Transmission!
    By uaf5000 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 25th August 2010, 04:39
  3. serial data to LCD
    By cunninghamjohn in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 25th November 2008, 15:50
  4. Replies: 7
    Last Post: - 6th February 2008, 05:38
  5. Multiplex serial data
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 19th May 2004, 00:28

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