Rc signal help


Results 1 to 40 of 43

Thread: Rc signal help

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Well I just compiled the following and I get flashing LEDs (I haven't got the time this morning to hook up a receiver and test the reading of the PPM signal)

    Code:
    '12F675
    @ __CONFIG _INTRC_OSC_CLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF
    
    
    DEFINE OSC 4
    OPTION_REG.5 = 0 ' clock source internal
    CMCON = 7
    ANSEL=0
    
    Pulselen var word ' Pulselen can be 0 - 255, 100 = 1 ms, 200 = 2 ms
    Init var word ' Init used to flash LED
    Clear ' set all variables = 0
    
    Input GPIO.4 ' set pin 5 to RX signal
    
    ReadPWM:
    PulsIn GPIO.4, 1,Pulselen ' pin 4 - read high pulse length, times out after .65535 seconds
    pause 15
    If Pulselen < 50 Then GoTo Blink ' no signal -> blink led
    If Pulselen > 75 Then GoTo solid ' signal -> Solid led
    GoTo ReadPWM
    
    Blink:
    For Init = 1 To 3 ' blink led 3 times
    High GPIO.1
    pause 200
    Low GPIO.1
    pause 200
    Next
    pause 1000
    GoTo ReadPWM
    
    Solid:
    High GPIO.1
    pause 3000
    Low GPIO.1
    pause 200
    GoTo ReadPWM
    END
    The only change I made was to use GPIO.4 and not GPIO.3

    EDIT:
    OK so I couldn't go out without testing the code to see if it reads the PPM signal.. sorry to say it doesn't detect it
    Last edited by malc-c; - 26th August 2006 at 08:37.

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