To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 13484
13483  |  13485
Subject: 
Re: VLL *input* for RCX/CyberMaster (in NQC) ?
Newsgroups: 
lugnet.robotics
Date: 
Fri, 15 Dec 2000 12:01:32 GMT
Original-From: 
Marco C. <marco@soporcel.pt*AvoidSpam*>
Viewed: 
703 times
  
At 15:09 13-12-2000 +0000, Marco C. wrote:
Is there already any NQC code for *reading* VLL ?

Progress report:

I decided to completly redo the Shigeru Makino's (mac@research.co.jp)
libvll.nqc approach.

My pBrick Serial Comms lib will not calculate the 3 bit checksum in
real-time. It's cpu time consuming.
I think it's faster to have'm all pre-calculated in 127 NQC #define
statements.
I've already made this "table".
(AFAIK there are a total of 62 possible codes not used by MicroScout nor by
CodePilot that can be used for customized rcx<->cybermaster message/command
communication)

I'm also thinking (must test it 1st) of using this approach to the actual
sending sequence, scrapping away the bit by bit crunching NQC rotine.

On one hand, I can have something like this and have a rotine accepting the
decimal code and decompose the 10 bit code:

...
// VLL code table dec   bin chk data
#define mcVLLcode000 896 // 111 0000000
#define mcVLLcode005 133 // 001 0000101
#define mcVLLcode062 958 // 111 0111110
// CodePilot VLL commands
#define mcVLLcpFWD mcVLLcode000 // 0 Motor Forward
#define mcVLLcpHelicopter mcVLLcode005 // 5 Sound - Helicopter
// Available codes for custom VLL commands
#define mcVLLxxFALSE mcVLLcode062 // False, No, Off
...

on the other, I can have the VLL code table with predefined cmd sequences
like this:

...
// abrevdefs - 0/1
#ifdef mcVLLdirectOUT
#define _0 Off(_oP);wait(_0T);Float(_oP);wait(_1T)
#define _1 Off(_oP);wait(_1T);Float(_oP);wait(_0T)
#else
#ifdef mcVLLlightOUT
#define _0 On(_oP);wait(_0T);Off(_oP);wait(_1T)
#define _1 On(_oP);wait(_1T);Off(_oP);wait(_0T)
#else
#ifdef mcVLLlightsensorOUT
#define _0 SetSensor(_oP,_1S);wait(_0T);SetSensor(_oP,_0S);wait(_1T)
#define _1 SetSensor(_oP,_1S);wait(_1T);SetSensor(_oP,_0S);wait(_0T)
...
// VLL code table
#define mcVLLcode000 _1;_1;_1; _0;_0;_0;_0;_0;_0;_0
...

Must check the balance between speed vs. memory occupied, if lot of VLL
commands are to be sent/used to another VLL-enabled pBrick.

All combinations of Output Ports/Medium will be handled:
Direct (Electric) Output through OUT port (RCX->CyberMaster)
Light Output through OUT port (LEGO Lamp or Fiber Optics)
Light Output through IN port (Light sensor's LED)

Future step: do the, if at all possible, input in NQC.
It'll handle all possible combinations of Input Ports/Medium:
Direct (Electric) Input through IN port (CyberMaster<-RCX)
Light Input through IN port (Light sensor's LED)

Any thought's, ideas, comments are welcome.

Marco C. aka McViper aka MediaCult
__________________________________
Work mailto:mcviper@geocities.com
Home mailto:mcviper@clix.pt



Message is in Reply To:
  VLL *input* for RCX/CyberMaster (in NQC) ?
 
Is there already any NQC code for *reading* VLL ? I've adapted the libvll.nqc to work *also* with direct connections (OUT port ->lego standard electrical wire-> IN port) using the Off() & Float() mainly for CyberMaster<->RCX comms [Note: By mistake, (...) (24 years ago, 13-Dec-00, to lugnet.robotics)

2 Messages in This Thread:

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

Custom Search

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