To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.spyboticsOpen lugnet.robotics.spybotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Spybotics / 203
202  |  204
Subject: 
Re: Spybotics Comms
Newsgroups: 
lugnet.robotics.spybotics, lugnet.robotics.rcx.nqc, lugnet.robotics
Followup-To: 
lugnet.robotics.spybotics
Date: 
Fri, 4 Apr 2003 03:10:08 GMT
Viewed: 
12235 times
  
In lugnet.robotics.spybotics, Marco Correia writes:
[snip]
So now I can have a setup like:
Cybermaster--VLL->Spybot--IR->RCX--IR->Manas, eh ! :)

so what's missing here ?
oh, inter-Spybot comms, right :)
hmmm... can a Spybot send IR to another Spybot ?
Can a Spybot send Manas/Spybot IR like protocol
and/or can it accept RCX/Scout IR like messages also ?

I need help answering the question "Can a Spybot send Mana IR-like protocol?
I want my Spybot to control my mana. I'm too stupid to interpret to Spybot SDK
on my own, and there's no support in NQC (spy.nqh or spyutils.nqh) yet for
this. Surely if VLL in the the firmware, then the Mana IR protocol is, too?

Has anyone succeeded at this, or can anyone point me in the right direction, or
enlighten me?

On the off chance it would work, I tried the following NQC code to make one
Spybot (set on channel 1) control another spybot (set on channel 2). It
compiled (no surprise), downloaded (slight surprise), and appeared to run
(surprise), but didn't work (no surprise):

/* Use a spybot to control a mana.

   My spybot is sits atop my mana. The mana drives the drive wheels and
   steering axle. The spybot and mana can see each other's IR, but the mana
   can't easily see the IR of a remote control.
   The spybot drives the vehicles accessories.  I need to use
   a spybot remote to tell the spybot to tell the mana to control the mana's
   motors.

*/

#include "spy.nqh"

// This is copied from the NQC api
#define SerialPacket() @(0x210010)
#define SerialComm() @(0x210011)
#define SerialData(n) @(0x210000 + (n)) // data for SendSer

__nolist void SetSerialPacket(const int &v) { Set(SerialPacket(), v); }
__nolist void SetSerialComm(const int &v) { Set(SerialComm(), v); }
__nolist void SetSerialData(const int n, const int &v) { Set(SerialData(n),
v); }

// values for SerPacket
#define SERIAL_PACKET_DEFAULT 0 // raw serial, no checksum, no preamble
#define SERIAL_PACKET_PREAMBLE 1
#define SERIAL_PACKET_NEGATED 2 // includes checksum
#define SERIAL_PACKET_CHECKSUM 4 // use this for checksum w/o negated
#define SERIAL_PACKET_RCX (SERIAL_PACKET_PREAMBLE + SERIAL_PACKET_NEGATED)

// values for SerComm
#define SERIAL_COMM_DEFAULT 0
#define SERIAL_COMM_4800 1 // default is 2400 baud
#define SERIAL_COMM_76KHZ 2 // default is 38kHz
#define SERIAL_COMM_DUTY25 4 // default is 50% duty cycle

__nolist void SendSerial(const int first, const int count) { asm { 0xc2,
first, count }; }

__nolist void InternalMessage(const int m) { asm { 0xf7, m }; }

// end copy from NQC API

// The rest is adapted from http://news.lugnet.com/robotics/spybotics/?n=56
  #define EVENT_1 0

task main()
{
  SetSerialComm(SERIAL_COMM_4800|SERIAL_COMM_DUTY25|SERIAL_COMM_76KHZ);
  SetSerialPacket(SERIAL_PACKET_DEFAULT);


  SetEvent(EVENT_1, SENSOR_1, EVENT_TYPE_PRESSED);

  while (true)
    {
    monitor (EVENT_MASK(EVENT_1) )
      {
      Wait(100);
      }
    catch
      {
      // Same as SpyBot controller left-forward button (channel 2)
      SetSerialData(0,0x60);
      SetSerialData(1,0x73);
      SendSerial(0,2);
      }
    }
}



Message is in Reply To:
  RE: Spybotics Comms
 
WOW! :) Thank you very much Mark ! Cool, it's all true then :) The usable firmware VLL input together with RCX/Scout IR messages output and the Manas/Spybot IR input. So now I can have a setup like: Cybermaster--VLL->Sp...IR->Manas, eh ! :) so (...) (22 years ago, 20-Aug-02, to lugnet.robotics.spybotics)

12 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