To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 244
243  |  245
Subject: 
Re: Blocking IR
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sun, 20 Jun 1999 23:30:59 GMT
Viewed: 
1411 times
  
Kekoa Proudfoot <kekoa@pixel.Stanford.EDU> wrote:
Maybe the light sensor just does not receive IR light like you expect it
to, despite your experiences with the IR remote?  I will try to write a
program to do what you seem to be trying to do, since it will only take a
few minutes or so to do that.

So I just tried this, and it took more than a few minutes to get it to
work.  But it does work.

Apparently, the modulation of the IR signal is needed for the light sensor
to give a reading.  The standard modulation used during regular IR
transmission is sufficient.  I used the following code to set up the IR
signal:

    /* Set TxD to output */
    *(char *)0xffb8 = *(char *)0xfd84 |= 1; /* Set port 5 bit 0 to output */
    *(char *)0xffb6 &= ~1; /* Set port 5 bit 0 to low */

    /* Set up 38.5 kHz modulation */
    *(char *)0xffd0 = 9; /* clear on compare match A, div 8 */
    *(char *)0xffd1 = 0x13; /* toggle on compare match A */
    *(char *)0xffd2 = 0x1a; /* 26 cycles for 38.5 kHz carrier */

    /* Set range to long */
    *(char *)0xffb5 = *(char *)0xfd83 |= 1; /* Port 4 bit 0 output */
    *(char *)0xffb7 &= ~1; /* Port 4 bit 0 low */

I then polled the sensor and updated the display with the raw value as seen
by the a/d inputs, using a/d code that is similar to that used by the
firmware but much different from LegOS, as explained in a previous message
to this list.  I saw typical raw values around 750, with readings
constantly fluctuating between around 400 and 600 at several to tens of cm,
and a mostly constant reading of around 315 at 0 mm from the IR filter at
either side of center.

-Kekoa



Message has 1 Reply:
  Re: Blocking IR
 
In addition to what I mentioned in the previous message, I also set the sensor input port to active. Setting it to passive also works, in which case the ambient light level seems to be around 480-495, and the sensor aimed directly at the IR port (...) (25 years ago, 21-Jun-99, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: Blocking IR
 
(...) I doubt you have a broken RCX. If you did, firmdl.c would not download firmware correctly. (...) That is a good thing to try; I suppose it did not help things? (...) I don't see why you couldn't post the .srec file. I don't know if you also (...) (25 years ago, 20-Jun-99, to lugnet.robotics.rcx.legos)

12 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR