Rc signal help


Closed Thread
Results 1 to 40 of 43

Thread: Rc signal help

Hybrid View

  1. #1
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    I've changed your code a bit to make a simple RC Switch that turns on GPIO.1 in real time (ie activate the switch on the TX and the LED lights or goes out)

    I've also removed some parts that are not needed (input GPIO.3 for example as PULSIN automatically makes the pin an input)

    Code:
    '12F675
    @ __CONFIG _INTRC_OSC_CLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF
    OPTION_REG.5 = 0                                                       
    
    Pulselen   var Byte                                                   
    HighCode   Var Byte
    LowCode    Var Byte
    clear
    highcode = 0 ' setup vars to be changed
    lowcode = 200 ' setup vars to be changed
                                                              
    
    ReadPWM:
    PulsIn GPIO.3, 1,Pulselen                 
    If pulselen > highcode then Highcode = Pulselen 
    If pulselen < LowCode and Pulselen > 50 then Lowcode = Pulselen 
    if (Pulselen + 20) >= highcode then High GPIO.1                                                      
    If (Pulselen - 20) <= LowCode Then low GPIO.1                                                   	    
    GoTo ReadPWM
    Good result for the end of the day.

  2. #2
    Join Date
    Aug 2006
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    There ya go thanks for the help didn't notice the 2nd page or would have replied sooner

Similar Threads

  1. Replies: 24
    Last Post: - 1st December 2009, 08:01
  2. Decoding an incoming infrared signal: need advice
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 9th May 2008, 16:28
  3. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 14:19
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  5. Rc PCM signal Read (Help)
    By jetpr in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th March 2005, 03:37

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