VS1838B remote


Closed Thread
Results 1 to 19 of 19

Thread: VS1838B remote

Hybrid View

  1. #1
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: VS1838B remote

    Quote Originally Posted by Michael View Post
    Pulsin works great. Heck, I just used the first part of that rentron code and did this with it --
    I get a perfect momentary on/off with a bit of needed pause.


    Main:
    PULSIN PORTB.0,0,Leader ' leader pulse is ~9mS low-going
    IF Leader < 850 THEN
    LOW PORTB.2
    GOTO Main
    ENDIF

    IF LEADER > 850 THEN
    HIGH PORTB.2
    PAUSE 300
    ENDIF

    LEADER = 0
    PAUSE 100

    GOTO MAIN
    Just a question ......Why:-

    GOTO Main
    ENDIF
    I would assume the other way round .....Genuine question. I can never understand software fully :-)

    Andy

  2. #2
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: VS1838B remote

    I think it's a method of skipping other IF/THEN options.

    It could also be structured with...

    IF This THEN
    do something
    ELSEIF That THEN
    do something else
    ELSE None of the above
    Don't do anything
    ENDIF

    Only 1 option will be selected, forcing a break from the test once a match is found.

  3. #3
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: VS1838B remote

    Quote Originally Posted by mpgmike View Post
    I think it's a method of skipping other IF/THEN options.

    It could also be structured with...

    IF This THEN
    do something
    ELSEIF That THEN
    do something else
    ELSE None of the above
    Don't do anything
    ENDIF

    Only 1 option will be selected, forcing a break from the test once a match is found.
    Got it

    Thank you

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: VS1838B remote

    it's working fine but I added leader = 0 to clear it out (duh)
    should have thought of that.
    I need to put the breadboard in the sunshine and see if it stays stable.
    if not, I'll just add his decoding the bytes data

    kind of nice using any button on the remote

    Main:
    PULSIN PORTB.0,0,LEADER ' leader pulse is ~9mS low-going
    IF Leader < 850 THEN
    LOW PORTB.2
    LEADER = 0
    GOTO Main
    ENDIF

    and yes, could have used else but so simple just wanted to see if functions.
    Last edited by Michael; - 3rd April 2020 at 14:24.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: VS1838B remote

    Another one for F675 chip

    Code:
    '*  Author  : Craig S Gardner, Modified by Jonathan Peakall to  *
    '*          : allow baud rate selection.                        *
    CMCON = 7             ' Comparators OFF
    ANSEL = 0             ' A/D OFF -- Port pins all digital
    TRISIO = %010000    ' All I/O but GPIO3 = outputs
    GPIO = %000000      ' All 0 on boot
    
    
    sBaud var byte
    IRpulse_length var word(13)
    xx var Byte
    Command	Var	Byte
    Device Var Byte
    input gpio.3
    'clear
    pause 500
    sbaud = 2
    if gpio.3 = 1 then
      sBaud = 2
    endif
    
    if gpio.3 = 0 then
       sBaud = 0
    endif
    
    Getstartbits: 
    PuLSIN GPIO.1,0,IRpulse_length(0)
    if IRpulse_length(0) < 200 then
    goto getstartbits
    Endif
    
    for xx=1 to 12
    pulsin GPIO.1,0,IRpulse_length(xx)
    next  xx
    
    
    
    displaybits: 
    if IRpulse_length(1) < 100 then
    Command.bit0 = 0 
    Else	
    Command.bit0 = 1
    endif
    if IRpulse_length(2) < 100 then
    Command.bit1 = 0 
    Else	
    Command.bit1 = 1
    endif
    if IRpulse_length(3) < 100 then
    Command.bit2 = 0 
    Else	
    Command.bit2 = 1
    endif
    if IRpulse_length(4) < 100 then
    Command.bit3 = 0 
    Else	
    Command.bit3 = 1
    endif
    if IRpulse_length(5) < 100 then
    Command.bit4 = 0 
    Else	
    Command.bit4 = 1
    endif
    if IRpulse_length(6) < 100 then
    Command.bit5 = 0 
    Else	
    Command.bit5 = 1
    endif
    if IRpulse_length(7) < 100 then
    Command.bit6 = 0 
    Else	
    Command.bit6 = 1
    endif
    Command.bit7 = 0 
    Command = Command + 1
    If Command = 10 then
    Command = 0
    Endif
    
    
    
    if IRpulse_length(8) < 100 then
    Device.bit0 = 0 
    Else	
    Device.bit0 = 1
    endif
    if IRpulse_length(9) < 100 then
    Device.bit1 = 0 
    Else	
    Device.bit1 = 1
    endif
    if IRpulse_length(10) < 100 then
    Device.bit2 = 0 
    Else	
    Device.bit2 = 1
    endif
    if IRpulse_length(11) < 100 then
    Device.bit3 = 0 
    Else	
    Device.bit3 = 1
    endif
    'Device.bit1 = 0
    
    
    
    SEROUT GPIO.0,sbaud,[Device,Command]
    pause 100 
    goto Getstartbits
    Ioannis

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: VS1838B remote

    And another one, very educative.

    Controlling the world_SIRC.pdf

    Ioannis

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: VS1838B remote

    Thanks Ioannis. That pdf will be my reading later. I may want to do more sophisticated RC stuff also.
    This simple on/off is working great -- only sees NEC remotes. Tried others and no go which is good.
    I suppose you could even set up another counter to get simple on/offs on other pins, press twice within 10 seconds and so on.
    But not going there.

Similar Threads

  1. Remote Ip remote relay switch
    By jetpr in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 23rd June 2014, 17:07
  2. Remote control help
    By paulthegulll in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd November 2010, 09:01
  3. IR/RF Remote Control
    By jhorsburgh in forum General
    Replies: 2
    Last Post: - 6th February 2008, 02:23
  4. need help in decoding RC-5 IR-remote
    By vu2iia in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th August 2007, 04:34
  5. Remote control
    By Radiance in forum General
    Replies: 2
    Last Post: - 6th August 2003, 15:13

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