Results 1 to 6 of 6

Thread: Looking for an IR signal

  1. #1
    Senior Member
    Join Date
    Jan 1970
    Location
    UK
    Posts
    3,043

    Default Looking for an IR signal

    I have an application in which it is usually scrolling through a loop, checking various inputs. I want to add IR control, so using the rev-ed IR remote can take it out of this loop, and put it into other stages.

    I'm using a 28X - I'll probably upgrade it to a 28X1 when I order some more chips.

    I know the irfrain command hangs the program, so this would not be suitable in my loop. I previously decided I would need an 08M, which waits for an IR signal, then tells the 28X. More complex than I would like.

    However, I just noticed hippy said (in another thread):

    You may be able to scan for the presence of an IR signal ( goes low when signal present ) rather than INFRAIN'ing while stepping the motor but you could get tight on processing time ( 8MHz operation will help )...
    That sounds interesting. Will a if pin0=0 then infrared tell me when there is an infrared signal?

    Anyone tried this?

    A

  2. #2
    Moderator
    Join Date
    Jan 1970
    Location
    North Norfolk blow-in.
    Posts
    5,988
    Blog Entries
    1

    Default

    Andrew.

    Here's one of several threads.

    http://www.picaxeforum.co.uk/showthr...?t=8517&page=2

    Yes, it does work.

    e

  3. #3
    Technical Support
    Join Date
    Jan 1970
    Location
    UK
    Posts
    20,072

    Default

    Yes, that works fine. The only issue you have to deal with if you take that as an indication of IR transmission and then enter INFRAIN, it will stay there forever if it wasn't - Eg, any other IR remote ( TV, HiFi, light dimmer ) may trigger it.

    The solution there is to not use INFRAIN which blocks, but a bit-banged INFRAIN substutute which will bale out if nothing is received.

  4. #4
    Senior Member
    Join Date
    Jan 1970
    Location
    UK
    Posts
    3,043

    Default

    Or switch to a 28X1 and use irin. Probably much simpler than bit banging the IR readings.

    A

  5. #5
    Moderator
    Join Date
    Jan 1970
    Location
    North Norfolk blow-in.
    Posts
    5,988
    Blog Entries
    1

    Default

    Quote Originally Posted by Andrew Cowan View Post
    Or switch to a 28X1 and use irin. Probably much simpler than bit banging the IR readings.

    A
    This is working fine at the moment.
    Code:
    #picaxe 28x1
    
    setint %00000000,%00000001 ' low on pin0
    
    main:
      for b0 = 0 to 255
     sertxd (#b0, "  ")
     pause 250
     next
    goto main
    
    interrupt:
      irin [500,leaving], 0,b1  
     
    sertxd (cr,lf,"Interrupted at ",cr,lf)
    sertxd(#b1,cr,lf)
    outpins = b1
     
      pause 500 
      leaving:
      setint %00000000,%00000001 ' low on pin0
      return
    e
    Last edited by eclectic; 16-02-2009 at 15:36. Reason: corrected silly mistake.

  6. #6
    Senior Member
    Join Date
    Jan 1970
    Location
    UK
    Posts
    3,043

    Default

    Very helpful - thanks.

    A

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •