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 / 183
182  |  184
Subject: 
Led display on Spybot
Newsgroups: 
lugnet.robotics.spybotics
Date: 
Tue, 28 Jan 2003 15:39:18 GMT
Viewed: 
7052 times
  
Hello all,

After a few hours I now understand a little bit about the ROM routines
inside the Spybot.

To reach the 7 LED's on top of the bot you have to call sub 42. There are 8
different way's the Led's will blink.

To program the bot in BrickCC you need the following files:

Spytest.h

This file is used as an API and has to be included in the NQC code.
Copy and paste the following code into a file named spytest.h and store the
file in the folder c:\nqc\spy

#if defined(__SPY)

//LED display effects (0 to 7)

#define displayLedNone -1
#define displayLedScan 0
#define displayLedSparkle 1
#define displayLedFlash 2
#define displayLedRedToGreen 3
#define displayLedGreenToRed 4
#define displayLedPointForward 5
#define displayLedAlarm 6
#define displayLedThinking 7


__nolist void Disp (const int display)
{
  asm { 0xe3, &display } ;
  asm { 0x17, 42 };
  asm { 0x01, 1 };
}
#endif

Now we need a simple NQC program.
Open Brickcc and make a new file
Copy and paste the next program files into the new file

//Test sub 42
//sub 42 set up the LedDisplay
//André Koopman pa0akv@langweer.net

#include "c:\nqc\spy\spytest.h"

task main()
{
Disp(displayLedNone);
Wait(500);
Disp(displayLedScan);
Wait(500);
Disp(displayLedSparkle);
Wait(500);
Disp(displayLedFlash);
Wait(500);
Disp(displayLedRedToGreen);
Wait(500);
Disp(displayLedGreenToRed);
Wait(500);
Disp(displayLedPointForward);
Wait(500);
Disp(displayLedAlarm);
Wait(500);
Disp(displayLedThinking);
Wait(500);
}


Save it as a NQC file
Compile and download to the Spybot and run the program.
Nice result isn't it

Thanks to John Hansen (great Brickcc program !)and Mark Ferris who put me on
the right path !



Message has 1 Reply:
  Re: Led display on Spybot
 
(...) #if defined(__SPY) //LED display effects (0 to 7) #define displayLedNone -1 #define displayLedScan 0 #define displayLedSparkle 1 #define displayLedFlash 2 #define displayLedRedToGreen 3 #define displayLedGreenToRed 4 #define (...) (22 years ago, 28-Jan-03, to lugnet.robotics.spybotics)

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