To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.pbforthOpen lugnet.robotics.rcx.pbforth in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / pbFORTH / 27
26  |  28
Subject: 
Re: SENSOR_READ doesn't return 0
Newsgroups: 
lugnet.robotics.rcx.pbforth
Date: 
Tue, 13 Apr 1999 23:16:22 GMT
Reply-To: 
ROBOTS@JPSC.COihatespam.UK
Viewed: 
1619 times
  
..and now I have the answer, after extensive grepping around Kekoa's
disassembly and the pbFORTH .ASM files.

SENSOR_READ should return only the bottom byte, the call to 0x14C0 only
returns a byte so the high byte contains garbage (actually it seems to be
the high byte of the raw sensor word, which is why I was getting 0x300 and
0x200 returned). In raw mode SENSOR_RAW and SENSOR_VALUE return the same
thing.

For the moment I have recoded LIGHT? and it works:

: LIGHT? ( sensor -- value )
  BEGIN
    DUP SENSOR_READ
    FF AND 0=
  UNTIL
  SENSOR_VALUE
;

I think SENSOR_READ read should end with:
       MOV.B  r6l,rTOSl            ; Put result on top of stack
or whatever, I don't know this assembler. I guess the high byte should be
set to zero also.
--
John & James Cooper, Wallington, UK



Message has 1 Reply:
  RE: SENSOR_READ doesn't return 0
 
(...) John, Thanks a lot for this catch. Sounds a lot like the email I exchanged with Kekoa regarding power down mode and external stacks, but that's another story... Cheers, Ralph Hempel - P.Eng ---...--- Check out pbFORTH for LEGO Mindstorms at: (...) (26 years ago, 15-Apr-99, to lugnet.robotics.rcx.pbforth)

Message is in Reply To:
  RE: SENSOR_READ doesn't return 0
 
(...) AhA! Another victim within my clutches!!!!! Glad to hear you are trying things out, John. The more questions I get, the sooner I can get a FAQ out to help with the common ones. (...) That's a good sign, at least. (...) You have obviously had (...) (26 years ago, 13-Apr-99, to lugnet.robotics.rcx.pbforth)

10 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