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 / 2765
2764  |  2766
Subject: 
Re: simple but functional radar
Newsgroups: 
lugnet.robotics
Date: 
Thu, 14 Jan 1999 09:30:19 GMT
Original-From: 
Ben Williamson <benw@!ihatespam!pobox.com>
Viewed: 
3113 times
  
On Wed, 13 Jan 1999, Chris Stanley wrote:

i'm so new to this that i've not yet sat down and learned nqc or botcode or
the like.  radar.prg was written with the basic coder included on your
mindstorms cd.

Chris,

I built a little RadarBot just like yours (very minimalist, I love it :)
and wrote some NQC code to drive it around my kitchen floor.  It really
zooms, until the left wheel inevitably falls off.  :)

The program below might help you get started with NQC, which I thoroughly
recommend if you're at all familiar with C syntax.

Cheers,

- Ben.

-------------------------------------------------------------------
Ben Williamson       benw@pobox.com     http://www.pobox.com/~benw/



#define LIGHT IN_2

#define LEFT OUT_A
#define RIGHT OUT_C

#define SPEED 7

/* connections to both motors are reversed: */
#define L_FWD Rev(LEFT, SPEED)
#define L_REV Fwd(LEFT, SPEED)
#define R_FWD Rev(RIGHT, SPEED)
#define R_REV Fwd(RIGHT, SPEED)

#define STOP Off(LEFT); Off(RIGHT)

#define THRES 50

int light;

task main
{
Sensor(LIGHT,  IN_LIGHT);
IRMode(IR_HI);

L_FWD; R_FWD;
while (1==1) {
SendMessage(255);
light = LIGHT;
if (light > THRES) {
L_REV;
Sleep(10);
} else {
L_FWD;
}
}
}



--
Did you check the web site first?: http://www.crynwr.com/lego-robotics



Message has 1 Reply:
  Re: simple but functional radar
 
(...) I like it, our wheels stay on until it destroys itself by running full tilt into something black... Our design has two motors at the back driving wheels directly, and two free running castors at the sides as close to the front as possible, so (...) (26 years ago, 14-Jan-99, to lugnet.robotics)

Message is in Reply To:
  Re: simple but functional radar
 
i'm so new to this that i've not yet sat down and learned nqc or botcode or the like. radar.prg was written with the basic coder included on your mindstorms cd. i'll update my page to mention that. sorry for the confusion! -- Chris Stanley (...) (26 years ago, 13-Jan-99, to lugnet.robotics)

5 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
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
50 minutes ago
Custom Search

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