12f675_fuse_about_to_blow!


Results 1 to 40 of 929

Threaded View

  1. #33
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    I found this on a nest box website regarding the number of visits or rather the amount of food the parents bring to the young:

    Each chick can eat 100 caterpillars a day, so adults need to find as many as 1000 caterpillars a day for a brood of 10!
    So with this in mind a WORD would be needed as a counter, so I've modified the code to send a WORD instead of a BYTE and added a test number (600):

    Code:
    TEST   VAR word 
    
    LET Test = 600
    
    SEROUT2 D_OUT,BAUD,[PreAmble,Synch,DAT_OUT,DAT_OUT,CHK_SUM,TEST.HIGHBYTE,TEST.LOWBYTE]
    And for the receiver:

    Code:
    TEST  var word  
    
    X   VAR BYTE
    
    SERIN2 D_IN,N2400,[WAIT(Synch),DAT_IN1,DAT_IN2,CHK_SUM,TEST.HIGHBYTE,TEST.LOWBYTE]
    
     IF TEST = 600 THEN  LED    
        GOTO MAIN 
       
    lED:
       for X = 1 to TEST  'Test = 600
        HIGH PORTA.1  
        PAUSE 500
        LOW PORTA.1
        pause 500
        next X
        GOTO MAIN 
           
        END
    And it works, the led flashes 600 times (I know I've counted them)

    Another small step nearer.

    Dave
    Last edited by LEDave; - 30th November 2010 at 22:58.

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