Subject:
|
Re: Spybot Studies: display an 8-bit value
|
Newsgroups:
|
lugnet.robotics.spybotics
|
Date:
|
Fri, 7 Nov 2003 20:31:45 GMT
|
Viewed:
|
6056 times
|
| |
| |
In lugnet.robotics.spybotics, John Hansen wrote:
|
In lugnet.robotics.spybotics, Brian B. Alano wrote:
|
Now if I could only pass
the parameter on the stack to a subroutine, I wouldnt have to
inline all this code.... :)
I know Ive seen someone else do this already, but I cant find the link.
|
Mark Riley did this using MindScript but I dont recall having already seen
the equivalent in NQC.
http://news.lugnet.com/robotics/spybotics/?n=56
|
In case anyone was wondering (yeah, sure :-), this line in my original post:
led[iDisplay] = (x & 0x17) | ((x & 8) * 4) | ((x & 32) / 4)
rearranges the bits so that the lower 6 bits can easily be read left to right
(while looking at the bot from the front) with the MSB being the outer green LED
and the LSB being the opposite outer red LED. If youre fluent in binary, you
can read the value pretty quickly. I assume the bit rearrangement would be
needed for NQC also, but I havent tried it yet.
Mark
|
|
Message is in Reply To:
| | Re: Spybot Studies: display an 8-bit value
|
| (...) Mark Riley did this using MindScript but I don't recall having already seen the equivalent in NQC. (URL) than use a #define macro (speaking of which, I need to fix the syntax highlighting of preprocessor macros to account for multiple lines) I (...) (21 years ago, 7-Nov-03, to lugnet.robotics.spybotics)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|